Skip to content

Commit e4c7931

Browse files
authored
Only run pre-commit on the changes (#7106)
Run pre-commit on all files may change files that are not part of the current branch. The updated script will only run pre-commit on the files that have been changed in the current branch. Signed-off-by: Hongwei <hongweichen@microsoft.com>
1 parent 776822f commit e4c7931

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pre-commit install
1313
Afterwards, our suite of formatting tests run automatically before each `git commit`. You
1414
can also run these manually:
1515
```bash
16-
pre-commit run --all-files
16+
pre-commit run --files $(git diff --name-only master)
1717
```
1818
If a formatting test fails, it will fix the modified code in place and abort
1919
the `git commit`. After looking over the changes, you can `git add <modified files>`

0 commit comments

Comments
 (0)