forked from extern/flakelight
Clarify use of formatter option
The fact it uses bash is an implementation detail. Update the documentation to state that the input is a file name glob rather than a bash case match. Updates the default formatters to not rely on being a bash case statement.
This commit is contained in:
parent
1bc31924ee
commit
592cb247bf
@ -587,9 +587,9 @@ By default, `nix` files are formatted with `nixpkgs-fmt` and `md`, `json`, and
|
||||
To disable default formatters, set the `flakelight.builtinFormatters` option to
|
||||
false.
|
||||
|
||||
You can set `formatters` to an attribute set, for which the keys are a bash case
|
||||
pattern and the value is the formatting command. `formatters` can optionally be
|
||||
a function that takes packages and returns the above.
|
||||
You can set `formatters` to an attribute set, for which the keys are a file name
|
||||
pattern and the value is the corresponding formatting command. `formatters` can
|
||||
optionally be a function that takes packages and returns the above.
|
||||
|
||||
Formatting tools should be added to `devShell.packages` and all packages in
|
||||
`devShell.packages` will be available for formatting commands.
|
||||
|
@ -18,7 +18,9 @@ in
|
||||
|
||||
formatters = {
|
||||
"*.nix" = "nixpkgs-fmt";
|
||||
"*.md | *.json | *.yml" = "prettier --write";
|
||||
"*.md" = "prettier --write";
|
||||
"*.json" = "prettier --write";
|
||||
"*.yml" = "prettier --write";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user