Skip to content
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

pre-commit missing hook.yaml #50

Closed
rotten opened this issue Jun 3, 2021 · 6 comments
Closed

pre-commit missing hook.yaml #50

rotten opened this issue Jun 3, 2021 · 6 comments

Comments

@rotten
Copy link
Contributor

rotten commented Jun 3, 2021

I was trying to configure blue with a pre-commit hook in my repo.

Unfortunately it doesn't work by simply replacing the black repo with the blue repo (and updating the name and version) in my .pre-commit-config.yaml . The pre-commit command complains that the blue repo is missing a .pre-commit-hooks.yaml file.

I think it should be as simple as dropping one that looks like the black one in the top level directory.

Here is the black hooks file:
https://github.com/psf/black/blob/main/.pre-commit-hooks.yaml

This was how I configured my .pre-commit-config.yaml:

repos:
-   repo: https://github.com/grantjenks/blue.git
    rev: v0.6.0
    hooks:
    - id: blue
      args:
        - -l 120
        - -t py38

I tried manually configuring a .pre-commit-hooks.yaml file in my own repo with the blue id. Not surprisingly, that didn't really help. I'm not quite sure yet how to get blue to run as a pre-commit hook without that file being in the grantjenks/blue repo top level. Suggestions?

@rotten
Copy link
Contributor Author

rotten commented Jun 3, 2021

FWIW, here is the documentation that tells you about creating a .pre-commit-hooks.yaml file: https://pre-commit.com/#new-hooks

@rotten
Copy link
Contributor Author

rotten commented Jun 4, 2021

I forked this repo, added a simple .pre-commit-hooks.yaml, bumped the release version in my fork, and it now works as a pre-commit hook. I'm not sure if my pre-commit-hooks.yaml is up to your esteemed standards for such things, so I haven't try to PR it back to you. Let me know if you'd like me to do that anyhow.

@grantjenks
Copy link
Owner

Pull request welcome!

@rotten
Copy link
Contributor Author

rotten commented Jun 7, 2021

#51

@grantjenks
Copy link
Owner

Released in v0.7.0 to PyPI

@mazulo
Copy link

mazulo commented Dec 12, 2021

@rotten thank you! I was waiting for that and was actually about to just fork the repo if it wasn't there yet 😄

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

No branches or pull requests

3 participants