Add pre commit hooks#83
Open
ewu63 wants to merge 12 commits into
Open
Conversation
…cation with local-config preference
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Purpose
This PR adds a custom set of pre-commit hooks which vendor the lab-preferred config files. This allows repos to directly use these hooks without having to have a local copy of each config file per repo. The outcome should be identical to the CI workflows. Note that the root pyproject.toml had to be added to make this a package for pre-commit, and I had to move the config files into a sub-directory so it can be packaged.
The next steps would be:
There are some minor behaviour differences with existing workflows
excludeoption to pre-commitExpected time until merged
As long as it takes to review. This should not break any existing workflows but may take some time to test that the pre-commit works as expected.
Type of change
Testing
The command
try-repocan be used, e.g. if .github is in a folder parallel with say pyoptsparse:Checklist
ruff checkandruff formatto make sure the Python code adheres to PEP-8 and is consistently formattedfprettifyor C/C++ code withclang-formatas applicable