-
-
Notifications
You must be signed in to change notification settings - Fork 723
ENH: Initial configuration to introduce pre-commit #5013
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
hjmjohnson
merged 13 commits into
InsightSoftwareConsortium:master
from
hjmjohnson:test-pre-commit-hooks
Dec 6, 2024
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
245be3e
ENH: Update SetupForDevelopment to use pre-commit
hjmjohnson 61ebc62
ENH: Adding check-setup-for-development pre-commit check
hjmjohnson a580044
ENH: Remove unnecessary separate hooks repository links
hjmjohnson c3cc995
ENH: Update to include more pre-commit hooks
hjmjohnson 8566b46
ENH: Ignore pre-commit autofix to ThirdParty packages.
hjmjohnson 80226bf
ENH: Ignore Data directories for whitespace autofixing.
hjmjohnson 9d58190
ENH: Update for black formatting checking.
hjmjohnson 4e5ae8b
ENH: Fix executable status of script
hjmjohnson be90e87
STYLE: Enforce end-of-file consistency
hjmjohnson 0362f1f
STYLE: trim traling whitespace autofix
hjmjohnson 57723ec
STYLE: Enforce black formatting for toolkit.
hjmjohnson 530129a
ENH: Add clang-format to pre-commit hooks.
hjmjohnson 8b99c00
STYLE: Remove redundant cmake based clang-format
hjmjohnson 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 was deleted.
Oops, something went wrong.
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,78 @@ | ||
| # .pre-commit-config.yaml | ||
| # for details see https://pre-commit.com | ||
| # for list of available hooks see https://pre-commit.com/hooks.html | ||
| # | ||
| # Preclude commits that do not conform to various criteria. | ||
| # | ||
| # If a pre-commit check must be skipped then use: `SKIP=check_id git commit` Where `check_id` is the id of the check to | ||
| # be skipped such as `black`. | ||
|
|
||
| fail_fast: true | ||
| default_stages: [pre-commit] | ||
| repos: | ||
| - repo: https://github.com/pre-commit/pre-commit-hooks | ||
| rev: v5.0.0 | ||
| hooks: | ||
| - id: check-added-large-files | ||
| args: ['--maxkb=200'] | ||
| exclude: | | ||
| ( | ||
| Source/DataDictionary/gdcmPrivateDefaultDicts.cxx| | ||
| Documentation/watershed.ps | ||
| ) | ||
| - id: check-json | ||
| - id: check-toml | ||
| - id: check-yaml | ||
| - id: check-shebang-scripts-are-executable | ||
| - id: detect-private-key | ||
| - id: end-of-file-fixer | ||
| exclude: "\\.(md5|sha|sha512|svg|vtk|vtp)$|^Resources\\/[^\\/]+\\.h$|\\/ColorFiles\\/.+\\.txt$|Data\\/Input\\/.+$|\\/ThirdParty\\/|\\/Data\\/" | ||
| - id: forbid-new-submodules | ||
| - id: forbid-submodules | ||
| - id: mixed-line-ending | ||
| exclude: "\\.(sha|sha512|svg|vtk|vtp)$|\\/ThirdParty\\/|\\/Data\\/" | ||
| - id: name-tests-test | ||
| args: ['--pytest-test-first'] | ||
| - id: trailing-whitespace | ||
| exclude: "\\.(sha|sha512|svg|vtk|vtp)$|\\/ThirdParty\\/|\\/Data\\/" | ||
| - repo: https://github.com/pre-commit/mirrors-clang-format | ||
| rev: v19.1.4 | ||
| hooks: | ||
| - id: clang-format | ||
| args: ['--style=file'] | ||
| files: '\.(c|cc|h|cxx|hxx)$' | ||
| exclude: "\\/ThirdParty\\/|\\/Data\\/" | ||
| - repo: https://github.com/psf/black | ||
| rev: 24.2.0 | ||
| hooks: # check conformance to black formatting | ||
| - id: black | ||
| #args: ['--diff', '-v', '--target-version', 'py39' ] # if run without arguments, will fail and will format the files | ||
| args: ['--target-version', 'py39' ] # Allow black to fail and provide auto-formatting to files that need it for compliance | ||
| exclude: ".*build.*|\\/ThirdParty\\/|\\/Data\\/" | ||
| - repo: local | ||
| hooks: | ||
| - id: local-prepare-commit-msg | ||
| name: 'local prepare-commit-msg' | ||
| entry: 'Utilities/Hooks/prepare-commit-msg' | ||
| language: system | ||
| stages: [prepare-commit-msg] | ||
| - id: check-setup-for-development | ||
| name: 'Check version of SetupForDevelopment' | ||
| entry: 'Utilities/Hooks/check-setup-for-development' | ||
| language: system | ||
| stages: [pre-commit] | ||
| - id: local-pre-commit | ||
| name: 'local pre-commit' | ||
| entry: 'Utilities/Hooks/pre-commit' | ||
| language: system | ||
| stages: [pre-commit] | ||
| - id: kw-commit-msg | ||
| name: 'kw commit-msg' | ||
| entry: 'Utilities/Hooks/kw-commit-msg' | ||
| language: system | ||
| stages: [commit-msg] | ||
| - id: kw-pre-commit | ||
| name: 'kw-pre-commit' | ||
| entry: 'Utilities/Hooks/kw-pre-commit' | ||
| language: system | ||
| stages: [pre-commit] |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
|---|---|---|
|
|
@@ -298,4 +298,3 @@ | |
|
|
||
|
|
||
| */ | ||
|
|
||
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 |
|---|---|---|
|
|
@@ -37,4 +37,3 @@ | |
| * iterators. | ||
| * | ||
| */ | ||
|
|
||
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.
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.
@N-Dekker Ahh, with this commit, we will not be required to "know" about existence of
clang-format. Except for use in IDEs, such as Visual Studio 😄