Skip to content

Commit 63938f1

Browse files
committed
;just:format: be silent if there's no changes to commit
1 parent a59df34 commit 63938f1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Justfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ alias h := help
5959
@check:
6060
just --fmt --unstable --check
6161

62-
# if this justfile is error free but in non-standard format, reformat and commit it
62+
# if this justfile is error free but in non-standard format, reformat it, and if it has changes, commit it
6363
@format:
64-
just -q chk || just --fmt --unstable && git commit -m ';just: format' -- {{ justfile() }}
64+
just -q chk || just -q --fmt --unstable && git diff --quiet || git commit -m ';just: format' -- {{ justfile() }}
6565

6666
# rerun RECIPE when any watched-by-default file changes
6767
watch RECIPE *JOPTS:

0 commit comments

Comments
 (0)