-
Notifications
You must be signed in to change notification settings - Fork 4
feat: Use custom pre-commit config file #411
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
JordoHeffernan
merged 34 commits into
main
from
feat/secureli-373-use-custom-pre-commit-config
Mar 8, 2024
Merged
feat: Use custom pre-commit config file #411
JordoHeffernan
merged 34 commits into
main
from
feat/secureli-373-use-custom-pre-commit-config
Mar 8, 2024
Conversation
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
I'd like to add a source-controlled .pre-commit-config.yaml into `.secureli/`. This requires `.secureli/` to not be added to .gitignore, so I'm moving the existing contents there to a `local/` subfolder which will be ignored.
Using a custom location for our pre-commit hooks allows us to not destroy whatever existing configuration exists, opening the door to interoperability with existing installations of pre-commit and avoiding conflicts when e.g. we want to use a different set of hooks (or different versions of hooks) that what was already configured.
This reverts commit b0f1db9.
And auto-migrate. Also updated unit tests. Still need to add tests for new functionality.
Contributor
Author
|
This PR still needs some unit tests but otherwise I think it's pretty much ready for review. |
…s://github.com/slalombuild/secureli into feat/secureli-373-use-custom-pre-commit-config
isaac-heist-slalom
approved these changes
Mar 8, 2024
Contributor
isaac-heist-slalom
left a comment
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.
Looks good!
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.
secureli-373
Migrates
.pre-commit-config.yamlinto the.secureli/directory. This directory was previously ignored by git, so I moved its existing contents into.secureli/local/and told git to only ignore that subfolder. Using a nonstandard path for.pre-commit-config.yamlwill allow our tool to not destroy any existing configuration/hooks, and allows us to sidestep much of the complexity of attempting to merge our hooks with existing hooks.There are a lot of repeated hardcoded strings in this PR. I'm inclined to not do too much refactoring/rework to clean that up, since I'd like to do some significant refactoring in the near future.
Open Questions
pre-commit-config.yamlis better than.pre-commit-config.yaml.secureliis invoked in a repo with an existingsecureliinstallation, the user is met with this prompt:seCureLI has not yet been installed, install now? [Y/n]:Testing
secureli initin a new repository, then validated the contents & paths of the generated files.