-
Notifications
You must be signed in to change notification settings - Fork 48
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 style checks #336
Merged
Merged
Changes from 15 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
279f071
Add pre-commit configuration.
bdice f7f4500
Normalize line endings and remove trailing whitespace.
bdice 149d6d9
Add cmake-format/cmake-lint and copyright scripts.
bdice 6b88e66
Update copyrights of modified files.
bdice 514d6a1
Apply codespell changes.
bdice e452305
Enable cmake-lint.
bdice aa4cd92
Only run one file at a time in cmake-format. Something goes wrong whe…
bdice a161c47
Use pre-commit in CI.
bdice 3cbe3e0
Update hooks.
bdice 725353c
Add comment about bug in cmake-format.
bdice 92c1801
Revert whitespace changes to patches.
bdice 7e5936f
Merge branch 'pre-commit' of github.com:bdice/rapids-cmake into pre-c…
bdice 8adab3e
Merge remote-tracking branch 'upstream/branch-23.02' into pre-commit
bdice f32b512
Revert spelling and whitespace changes.
bdice 2a44e0f
Disable codespell and whitespace linters.
bdice 8e5602e
Remove set +e.
bdice File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
# Copyright (c) 2023, NVIDIA CORPORATION. | ||
|
||
repos: | ||
#- repo: https://github.com/pre-commit/pre-commit-hooks | ||
# rev: v4.4.0 | ||
# hooks: | ||
# - id: trailing-whitespace | ||
# exclude: | | ||
# (?x)^( | ||
# ^rapids-cmake/cpm/patches/.* | ||
# ) | ||
# - id: end-of-file-fixer | ||
# exclude: | | ||
# (?x)^( | ||
# ^rapids-cmake/cpm/patches/.* | ||
# ) | ||
- repo: https://github.com/pre-commit/mirrors-clang-format | ||
rev: v11.1.0 | ||
hooks: | ||
- id: clang-format | ||
types_or: [c, c++, cuda] | ||
args: ["-fallback-style=none", "-style=file", "-i"] | ||
#- repo: https://github.com/codespell-project/codespell | ||
# rev: v2.2.2 | ||
# hooks: | ||
# - id: codespell | ||
# exclude: | | ||
# (?x)^( | ||
# ^CHANGELOG.md$ | ||
# ) | ||
- 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] | ||
- id: cmake-format | ||
name: cmake-format | ||
entry: ./ci/checks/run-cmake-format.sh cmake-format | ||
language: python | ||
types: [cmake] | ||
# Note that pre-commit autoupdate does not update the versions | ||
# of dependencies, so we'll have to update this manually. | ||
additional_dependencies: | ||
- cmakelang==0.6.13 | ||
verbose: true | ||
require_serial: true | ||
files: | | ||
(?x)^( | ||
^rapids-cmake/.*$ | ||
) | ||
- id: cmake-lint | ||
name: cmake-lint | ||
entry: ./ci/checks/run-cmake-format.sh cmake-lint | ||
language: python | ||
types: [cmake] | ||
# Note that pre-commit autoupdate does not update the versions | ||
# of dependencies, so we'll have to update this manually. | ||
additional_dependencies: | ||
- cmakelang==0.6.13 | ||
verbose: true | ||
require_serial: true | ||
files: | | ||
(?x)^( | ||
^rapids-cmake/.*$ | ||
) | ||
|
||
default_language_version: | ||
python: python3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 can't make a suggestion for this via the web interface, but can you remove the
+e
on line 16 of this file?