Fix the pre-commit hook#257
Merged
henryiii merged 3 commits intoAug 10, 2023
Merged
Conversation
pre-commit now expects the `.pre-commit-hooks.yaml` file to be a list of hooks even if its just defining a single hook.
The repo-review script does not support being passed all the individual file names by pre-commit. So turn this off and just point it at the general repo
Without doing this one gets errors to the effect of `ModuleNotFoundError: No module named 'click'` Diving down this rabbit hole for individual requirements ends of requiring several additional dependencies for repo-review to function properly. This solves those issues.
henryiii
approved these changes
Aug 10, 2023
Collaborator
|
Thanks! |
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.
When trying to use the pre-commit hook as suggested by scientific-python/repo-review#123 (comment) I found several issues:
.pre-commit-hooks.yamlfile not containing alistand instead being adict.repo-reviewwould fail to run if it was passed all the individual files, which is the default behavior ofpre-commit.repo-reviewto function as a CLI tool forpre-commitfailed to be installed.This attempts to solve all these small issues.