Skip to content

Fix the pre-commit hook#257

Merged
henryiii merged 3 commits into
scientific-python:mainfrom
WilliamJamieson:bugfix/pre-commit
Aug 10, 2023
Merged

Fix the pre-commit hook#257
henryiii merged 3 commits into
scientific-python:mainfrom
WilliamJamieson:bugfix/pre-commit

Conversation

@WilliamJamieson

Copy link
Copy Markdown
Contributor

When trying to use the pre-commit hook as suggested by scientific-python/repo-review#123 (comment) I found several issues:

  1. The hook would fail to install due to the .pre-commit-hooks.yaml file not containing a list and instead being a dict.
  2. repo-review would fail to run if it was passed all the individual files, which is the default behavior of pre-commit.
  3. Several dependencies for repo-review to function as a CLI tool for pre-commit failed to be installed.

This attempts to solve all these small issues.

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 henryiii merged commit 5a11803 into scientific-python:main Aug 10, 2023
@henryiii

Copy link
Copy Markdown
Collaborator

Thanks!

@WilliamJamieson WilliamJamieson deleted the bugfix/pre-commit branch August 10, 2023 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants