Yapf: New tag; pre-commit config step

Created on 5 Dec 2020  路  7Comments  路  Source: google/yapf

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

All 7 comments

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.

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.

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.

@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

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

@gwelymernans can we expect/hope for a tag?

Thank you!

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bukzor picture bukzor  路  3Comments

youngmit picture youngmit  路  4Comments

samypr100 picture samypr100  路  6Comments

haphut picture haphut  路  3Comments

jrwrigh picture jrwrigh  路  6Comments