-
Notifications
You must be signed in to change notification settings - Fork 304
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
Use pre-commit for CI style checks. #3062
Changes from 7 commits
5b04cfd
9825b90
2e4f34f
46c3b86
999132a
95accc9
05f3732
8f253d3
d6d4f71
863ce7f
752412d
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 |
---|---|---|
|
@@ -4,28 +4,50 @@ | |
# To run: `pre-commit run --all-files` | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.3.0 | ||
rev: v4.4.0 | ||
hooks: | ||
- id: check-added-large-files | ||
- id: debug-statements | ||
- id: mixed-line-ending | ||
- repo: https://github.com/psf/black | ||
rev: 22.3.0 | ||
rev: 22.10.0 | ||
hooks: | ||
- id: black | ||
language_version: python3 | ||
exclude: versioneer.py | ||
args: [--target-version=py38] | ||
files: ^python/ | ||
- repo: https://github.com/PyCQA/flake8 | ||
rev: 3.8.4 | ||
rev: 6.0.0 | ||
hooks: | ||
- id: flake8 | ||
args: [--config=python/.flake8] | ||
files: ^python/ | ||
args: ["--config=setup.cfg"] | ||
files: python/.*$ | ||
types: [file] | ||
types_or: [python] # TODO: Enable [python, cython] | ||
additional_dependencies: ["flake8-force"] | ||
- repo: https://github.com/asottile/yesqa | ||
rev: v1.3.0 | ||
hooks: | ||
- id: yesqa | ||
additional_dependencies: | ||
- flake8==3.8.4 | ||
- flake8==6.0.0 | ||
- repo: https://github.com/pre-commit/mirrors-clang-format | ||
rev: v11.1.0 | ||
hooks: | ||
- id: clang-format | ||
exclude: | | ||
(?x)^( | ||
cpp/libcugraph_etl| | ||
cpp/tests/c_api/.* | ||
) | ||
Comment on lines
+39
to
+43
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. These exclusions are needed because |
||
types_or: [c, c++, cuda] | ||
args: ["-fallback-style=none", "-style=file", "-i"] | ||
- repo: local | ||
hooks: | ||
- id: copyright-check | ||
name: copyright-check | ||
entry: python ./ci/checks/copyright.py --git-modified-only --update-current-year | ||
language: python | ||
pass_filenames: false | ||
additional_dependencies: [gitpython] |
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 will enable flake8 on Cython files in a follow-up PR. Commit 2e4f34f is what I'll put in that PR.