mirror of
https://github.com/NixOS/nix
synced 2025-07-06 21:41:48 +02:00
Merge pull request #12200 from NixOS/mergify/bp/2.24-maintenance/pr-11613
doc/nix fmt: Do not document behavior we do not control (backport #11613)
This commit is contained in:
commit
4d2cc07b48
2 changed files with 10 additions and 16 deletions
|
@ -1,5 +1,14 @@
|
|||
R""(
|
||||
|
||||
# Description
|
||||
|
||||
`nix fmt` calls the formatter specified in the flake.
|
||||
|
||||
Flags can be forwarded to the formatter by using `--` followed by the flags.
|
||||
|
||||
Any arguments will be forwarded to the formatter. Typically these are the files to format.
|
||||
|
||||
|
||||
# Examples
|
||||
|
||||
With [nixpkgs-fmt](https://github.com/nix-community/nixpkgs-fmt):
|
||||
|
@ -13,10 +22,6 @@ With [nixpkgs-fmt](https://github.com/nix-community/nixpkgs-fmt):
|
|||
}
|
||||
```
|
||||
|
||||
- Format the current flake: `$ nix fmt`
|
||||
|
||||
- Format a specific folder or file: `$ nix fmt ./folder ./file.nix`
|
||||
|
||||
With [nixfmt](https://github.com/serokell/nixfmt):
|
||||
|
||||
```nix
|
||||
|
@ -28,8 +33,6 @@ With [nixfmt](https://github.com/serokell/nixfmt):
|
|||
}
|
||||
```
|
||||
|
||||
- Format specific files: `$ nix fmt ./file1.nix ./file2.nix`
|
||||
|
||||
With [Alejandra](https://github.com/kamadorueda/alejandra):
|
||||
|
||||
```nix
|
||||
|
@ -41,13 +44,4 @@ With [Alejandra](https://github.com/kamadorueda/alejandra):
|
|||
}
|
||||
```
|
||||
|
||||
- Format the current flake: `$ nix fmt`
|
||||
|
||||
- Format a specific folder or file: `$ nix fmt ./folder ./file.nix`
|
||||
|
||||
# Description
|
||||
|
||||
`nix fmt` will rewrite all Nix files (\*.nix) to a canonical format
|
||||
using the formatter specified in your flake.
|
||||
|
||||
)""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue