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-config README example not recommended by pre-commit #775

Closed
bk-equityzen opened this issue Mar 20, 2019 · 2 comments
Closed
Labels
C: integrations Editor plugins and other integrations

Comments

@bk-equityzen
Copy link

The readme recommends to use the following config:

repos:
-   repo: https://github.com/ambv/black
    rev: stable
    hooks:
    - id: black
      language_version: python3.6

But the pre-commit docs don't recommend this. This causes different developers getting different versions of black depending on when they install pre-commit

One example of how this broke things is the recent change in the pyproject.toml target-version option from 'cpy27' to ['py27'] which broke for developers that installed the pre-commit hook later.

From https://pre-commit.com/#using-the-latest-version-for-a-repository:

pre-commit assumes that the value of rev is an immutable ref (such as a tag or SHA) and will cache based on that. Using a branch name (or HEAD) for the value of rev is not supported and will only represent the state of that mutable ref at the time of hook installation (and will NOT update automatically).

@bk-equityzen bk-equityzen changed the title .pre-commit-config README example not recommended by prec .pre-commit-config README example not recommended by pre-commit Mar 20, 2019
@JelleZijlstra JelleZijlstra added the C: integrations Editor plugins and other integrations label May 5, 2019
@asottile
Copy link
Contributor

Duplicate of #420

@JelleZijlstra
Copy link
Collaborator

Closed as a duplicate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: integrations Editor plugins and other integrations
Projects
None yet
Development

No branches or pull requests

3 participants