You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -291,9 +291,9 @@ to return back to the unmerged state.
291
291
292
292
## Usage
293
293
294
-
*`nixfmt < input.nix` – reads Nix code from `stdin`, formats it, and outputs to `stdout`
294
+
*`echo "{a=1;}" | nixfmt --stdin-filepath input.nix` – reads Nix code from `stdin`, formats it, and outputs to `stdout` (the filepath (`input.nix`) is only used for error messages)
295
295
*`nixfmt file.nix` – format the file in place
296
296
297
-
## Acknowledgements
297
+
## Acknowledgments
298
298
299
299
`nixfmt` was originally developed by [Serokell](https://github.com/serokell) and later donated to become an official Nix project with the acceptance of [RFC 166](https://github.com/NixOS/rfcs/pull/166).
"Pretty print the internal AST, only for debugging",
92
-
filename=
91
+
stdin_filepath=
93
92
Nothing
94
93
&= help
95
-
"The filename to display when the file input is given through stdin.\n\
96
-
\Useful for tools like editors and autoformatters that wish to use Nixfmt without providing it direct file access, while still providing context to where the file is.",
94
+
"Format the contents of stdin. When specified, no positional arguments are allowed.\n\
95
+
\The filepath is is only used for error messages.",
97
96
ir =
98
97
False
99
98
&= help
@@ -153,8 +152,8 @@ checkTarget format Target{tDoRead, tPath} = do
0 commit comments