Skip to content

Commit 5894e6b

Browse files
hwchen2017saurabhkoshatwar
authored andcommitted
Only run pre-commit on the changes (deepspeedai#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> Signed-off-by: Saurabh <saurabhkoshatwar1996@gmail.com>
1 parent d2b6dff commit 5894e6b

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)