-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,22 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: a11d9314b22d8f8c7556443875b731ef05965464 | ||
rev: v4.6.0 | ||
hooks: | ||
- id: check-added-large-files | ||
args: ['--maxkb=512'] | ||
- id: check-case-conflict | ||
- id: check-merge-conflict | ||
- id: check-symlinks | ||
- id: detect-private-key | ||
files: (?!.*paddle)^.*$ | ||
- id: end-of-file-fixer | ||
files: \.md$ | ||
- id: trailing-whitespace | ||
files: \.md$ | ||
files: \.(c|cc|cxx|cpp|cu|h|hpp|hxx|py|md)$ | ||
- repo: https://github.com/Lucas-C/pre-commit-hooks | ||
rev: v1.0.1 | ||
rev: v1.5.1 | ||
hooks: | ||
- id: forbid-crlf | ||
files: \.md$ | ||
- id: remove-crlf | ||
files: \.md$ | ||
- id: forbid-tabs | ||
files: \.md$ | ||
- id: remove-tabs | ||
files: \.md$ | ||
files: \.(c|cc|cxx|cpp|cu|h|hpp|hxx|py|md)$ | ||
- repo: local | ||
hooks: | ||
- id: clang-format | ||
|
@@ -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 commentThe 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 commentThe 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. |
||
rev: 23.3.0 | ||
rev: 24.4.2 | ||
hooks: | ||
- id: black | ||
files: (.*\.(py|pyi|bzl)|BUILD|.*\.BUILD|WORKSPACE)$ | ||
|
@@ -47,4 +43,3 @@ repos: | |
- --show-source | ||
- --statistics | ||
exclude: ^benchmark/|^test_tipc/ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,4 +27,4 @@ K06 | |
KIEY | ||
NZQJ | ||
UN1B | ||
6X4 | ||
6X4 |
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.