-
Notifications
You must be signed in to change notification settings - Fork 7.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update common pre-commit configs #12516
update common pre-commit configs #12516
Conversation
@@ -31,7 +27,7 @@ repos: | |||
files: \.(c|cc|cxx|cpp|cu|h|hpp|hxx|cuh|proto)$ | |||
# For Python files | |||
- repo: https://github.com/psf/black.git |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm just curious why the Flake8 tool is used? Why not just use Black tools?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SWHL These folders are excluded because they contain numerous bugs that are too time-consuming to fix and will be addressed at a later date.
hooks: | ||
- id: check-added-large-files | ||
args: ['--maxkb=512'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm more concerned that 512kb won't be enough for our use, as some of the previous files had more than 512kb in them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will only be applied to local staged files as documented here: https://github.com/pre-commit/pre-commit-hooks?tab=readme-ov-file#check-added-large-files. which means, current .github/workflows/codestyle.yml will not capture large files being added.
Another option : increase the limit to 1024kb, and check all the files on each pull_request by using --enforce-all
, at the same time, exclude existing large files. there are 28 files larger than 1M in the repo.
@@ -31,7 +27,7 @@ repos: | |||
files: \.(c|cc|cxx|cpp|cu|h|hpp|hxx|cuh|proto)$ | |||
# For Python files | |||
- repo: https://github.com/psf/black.git |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SWHL These folders are excluded because they contain numerous bugs that are too time-consuming to fix and will be addressed at a later date.
cfcc492
to
f722c18
Compare
f722c18
to
f05759a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
update common pre-commit configs and commit the results of running pre-commit run -a
will mark this PR as WIP, since we may need to discuss are there any other checks needed for the repository.
please review .pre-commit-config.yaml file, all others are the results of running
pre-commit run -a
.