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

New tag; pre-commit config step #882

Closed
Harkirat155 opened this issue Dec 5, 2020 · 7 comments
Closed

New tag; pre-commit config step #882

Harkirat155 opened this issue Dec 5, 2020 · 7 comments

Comments

@Harkirat155
Copy link
Contributor

A new tag should be created for pre-commit config #878 to come into effect.
Since, the usage of a GitHub repository or a hook configured repo as a pre-commit hook requires a reference version/tag to pull from the base,

Cheers

@barrywhart
Copy link

Related: pre-commit wants the hook file to be called .pre-commit-hooks.yaml, but it's called .pre-commit-hooks.yml. This results in an error when trying to install the hook, e.g.:

=====> /Users/bhart/.cache/pre-commit/repoknifs866/.pre-commit-hooks.yaml does not exist
Check the log at /Users/bhart/.cache/pre-commit/pre-commit.log

Simply renaming the two pre-commit config files should address this issue.

@Harkirat155
Copy link
Contributor Author

Harkirat155 commented Dec 6, 2020

Oh, that's a nice catch. We could certainly try naming it in that manner.

But according to me that would not suffice, if you could please verify, by checking out /Users/bhart/.cache/pre-commit/repoknifs866/ directory on your local machine.
The directory would currently not have the pre-commit-hooks.yml file, since pre-commit would reference a tag, and the latest tag at yapf, doesn't currently encompass these changes.
Hence, a new tag is required. But sure, we should rename the files as is recommended in the documentation.

@barrywhart
Copy link

I agree, a tag is needed, as you say, in addition to renaming. I mentioned it on this ticket because it's a "blocker" that needs to be addressed before tagging, and I didn't want to create a separate ticket since both changes are simple.

Harkirat155 added a commit to Harkirat155/yapf that referenced this issue Dec 7, 2020
pull upstream
@tpdownes
Copy link

tpdownes commented Feb 26, 2021

@gwelymernans this issue isn't actually resolved. A new tag is still needed to be able to refer to this repo in external projects. I need to be able to say something like:

$ cat .pre-commit-config.yaml
repos:
  - repo: https://github.com/google/yapf
    rev: v0.31.0
    hooks:
      - id: yapf
        name: yapf
        language: python
        entry: yapf
        args: [-i, -vv]
        types: [python]

I can choose to use a rev that is a commit hash in the interim but it's not great and I'm not sure it works well with pre-commit autoupdate

@barrywhart
Copy link

To clarify @tpdownes comment, there needs to be a git tag in the repo. Here is a GitHub screenshot of some of the current tags.

image

@tpdownes
Copy link

@gwelymernans can we expect/hope for a tag?

@tpdownes
Copy link

tpdownes commented Mar 25, 2021

Thank you!

For those who used ref by commit hash, pre-commit autoupdate works just fine. It follows the git graph.

b0ri5 added a commit to b0ri5/solvents that referenced this issue Oct 22, 2021
See google/yapf#882 (comment). I'm not sure if the .git hooks folder needs to be committed or not but I'll not.

Useful commands:
pip install pre-commit
pre-commit run --all-files
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