Skip to content

Commit

Permalink
docs: use rustfmt instead of cargo fmt in pre-commit
Browse files Browse the repository at this point in the history
The `cargo fmt` command recommended to include in the `pre-commit` hook
will run on all files, instead of just the changed files as intended.
This change uses `rustfmt` to just run on one file at a time as
intended.
  • Loading branch information
obycode committed Jul 19, 2023
1 parent c8ebe3e commit cec7b4b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ you push your code. Follow these instruction to set it up:
#!/bin/sh
HAS_ISSUES=0
for file in $(git diff --name-only --staged); do
FMT_RESULT="$(cargo fmt -- $file --check --config group_imports=StdExternalCrate 2>/dev/null || true)"
FMT_RESULT="$(rustfmt $file --check --config group_imports=StdExternalCrate 2>/dev/null || true)"
if [ "$FMT_RESULT" != "" ]; then
HAS_ISSUES=1
fi
Expand Down

0 comments on commit cec7b4b

Please sign in to comment.