Skip to content
This repository was archived by the owner on Sep 1, 2025. It is now read-only.

Commit f026919

Browse files
committed
feat(back): #1332 add check flag to nixfmt
- Run check only in CI, locally it will format the code - Update docs to show the use of nixfmt instead of Alejandra Signed-off-by: Robin Quintero <rohaquinlop301@gmail.com>
1 parent dcb3432 commit f026919

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

docs/src/api/builtins/format.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ Example:
8080
## formatNix
8181

8282
Ensure that Nix code is formatted
83-
according to [Alejandra](https://github.com/kamadorueda/alejandra).
83+
according to [nixfmt](https://github.com/NixOS/nixfmt).
8484

8585
Types:
8686

src/args/format-nix/entrypoint.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,15 @@
22

33
function main {
44
source __argTargets__/template local targets
5+
local args=()
56

67
info Formatting Nix code \
8+
&& if running_in_ci_cd_provider; then
9+
args+=(--check)
10+
fi \
711
&& for target in "${targets[@]}"; do
812
info Formatting "${target}" \
9-
&& if ! nixfmt "${target}"; then
13+
&& if ! nixfmt "${args[@]}" "${target}"; then
1014
info Source code was formated, the job will fail \
1115
&& error Failing as promised...
1216
fi \

0 commit comments

Comments
 (0)