-
Notifications
You must be signed in to change notification settings - Fork 290
[CI] add pre-commit integration
#955
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
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
567d1db
chore: misc cleanup
XuehaiPan cebf47b
feat: add pre-commit config
XuehaiPan 4ad758a
chore: update lint dependencies
XuehaiPan 8b853b6
style: fix lint issues
XuehaiPan f6d2cc7
feat: add pre-commit hooks
XuehaiPan bcc9c87
fix: fix typos
XuehaiPan b13e648
Merge branch 'main' into add-pre-commit-config
XuehaiPan 7721806
Merge remote-tracking branch 'origin/main' into add-pre-commit-config
XuehaiPan a6d59fc
chore: update .gitattributes
XuehaiPan 592ddd9
Merge remote-tracking branch 'origin/main' into add-pre-commit-config
XuehaiPan 9011f4a
[Lint]: [pre-commit.ci] auto fixes [...]
pre-commit-ci[bot] 3ca61ac
docs: update CONTRIBUTING.md
XuehaiPan a7a62bd
chore: update default venv name
XuehaiPan f57e23a
Merge branch 'main' into add-pre-commit-config
XuehaiPan 0439302
chore: revert and exclude CUDA files
XuehaiPan 00ef439
Merge branch 'main' into add-pre-commit-config
XuehaiPan 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 hidden or 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,8 @@ | ||
| --- | ||
| BasedOnStyle: LLVM | ||
| UseTab: Never | ||
| IndentWidth: 2 | ||
| ColumnLimit: 80 | ||
|
|
||
| Language: Cpp | ||
| Standard: c++17 |
This file contains hidden or 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
This file contains hidden or 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 |
|---|---|---|
| @@ -1 +1,10 @@ | ||
| * text eol=lf | ||
| *.bat eol=crlf | ||
|
|
||
| *.svg binary | ||
| *.jpg binary | ||
| *.jpeg binary | ||
| *.png binary | ||
| *.gif binary | ||
|
|
||
| *.h linguist-language=C++ |
This file contains hidden or 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
This file contains hidden or 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,60 @@ | ||
| # See https://pre-commit.com for more information | ||
| # See https://pre-commit.com/hooks.html for more hooks | ||
| ci: | ||
| autofix_prs: true | ||
| autofix_commit_msg: "[Lint]: [pre-commit.ci] auto fixes [...]" | ||
| autoupdate_commit_msg: "[CI] [pre-commit.ci] autoupdate" | ||
| autoupdate_schedule: monthly | ||
| default_stages: [pre-commit, pre-push, manual] | ||
| exclude: '^(build|3rdparty)/.*$' # exclude build and 3rdparty directories | ||
| repos: | ||
| - repo: https://github.com/pre-commit/pre-commit-hooks | ||
| rev: v6.0.0 | ||
| hooks: | ||
| - id: check-symlinks | ||
| - id: destroyed-symlinks | ||
| # FIXME: enable these hooks | ||
| # - id: trailing-whitespace | ||
| # - id: end-of-file-fixer | ||
| - id: check-added-large-files | ||
| - id: check-merge-conflict | ||
| fail_fast: true | ||
| # FIXME: enable these hooks | ||
| # - id: check-executables-have-shebangs | ||
| # - id: check-shebang-scripts-are-executable | ||
| - id: detect-private-key | ||
| - id: check-yaml | ||
| - id: check-toml | ||
| - id: check-ast | ||
| fail_fast: true | ||
| - id: debug-statements | ||
| - repo: https://github.com/pre-commit/mirrors-clang-format | ||
| rev: v15.0.7 # sync with requirements-lint.txt | ||
| hooks: | ||
| - id: clang-format | ||
| exclude: | | ||
| (?ix)( | ||
| ^.+\.(cu|cuh)$| | ||
| ^.+\.json$ | ||
| ) | ||
| - repo: https://github.com/astral-sh/ruff-pre-commit | ||
| rev: v0.14.0 # sync with requirements-lint.txt | ||
| hooks: | ||
| - id: ruff-check | ||
| args: [--fix, --exit-non-zero-on-fix] | ||
| - repo: https://github.com/google/yapf | ||
| rev: v0.43.0 # sync with requirements-lint.txt | ||
| hooks: | ||
| - id: yapf | ||
| args: [--recursive, --in-place] | ||
| - repo: https://github.com/codespell-project/codespell | ||
| rev: v2.4.1 # sync with requirements-lint.txt | ||
| hooks: | ||
| - id: codespell | ||
| additional_dependencies: [".[toml]"] | ||
| exclude: | | ||
| (?x)( | ||
| ^.+\.(cpp|hpp|cxx|cc|c|h|cu|cuh)$| | ||
| ^.+\.svg$| | ||
| ^.*\brequirements\b.*\.txt$ | ||
| ) |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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 |
|---|---|---|
| @@ -1,8 +1,7 @@ | ||
| # formatting | ||
| yapf==0.40.2 | ||
| toml==0.10.2 | ||
| tomli==2.0.1 | ||
| ruff==0.6.5 | ||
| codespell==2.3.0 | ||
| pre-commit | ||
| yapf==0.43.0 | ||
| ruff==0.14.0 | ||
| codespell[toml]==2.4.1 | ||
| clang-format==15.0.7 | ||
| clang-tidy==18.1.8 |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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.
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.
Uh oh!
There was an error while loading. Please reload this page.