You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This prevents any dummies like me from accidentally having a
different rustfmt configuration picked up from a parent directory,
since rustfmt will scan all the way up to the root directory to
find one. It will also ensure that CI builds will break if
misformatted code is uploaded.
To fail early and avoid unnecessary cycles of bad formatting being
committed and then fixed, it is a good idea to add a
`.git/hooks/pre-commit` file locally that checks staged files for
formatting errors:
```sh
git diff --name-only --cached -z '*.rs' |xargs -0 rustfmt --check || exit 1
```
0 commit comments