Skip to content

Conversation

@paulhfischer
Copy link
Contributor

resolves #974

  • only added a warning instead of raising an error because this might break multiple projects otherwise
  • not sure if other mutable revs should also cause a warning, couldn't think of a way to detect them in general …
  • the check could also be included in the MigrateShaToRev-class, but i think it's better to keep them separated
  • test only checks for HEAD, this is sufficient imo, but i can also change it so it tests for all mutable revs defined in {'HEAD', 'stable', 'master'}

Copy link
Member

@asottile asottile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@asottile asottile merged commit 0ed7930 into pre-commit:master Dec 18, 2020
@paulhfischer paulhfischer deleted the warn_if_mutable_rev_is_used branch December 18, 2020 23:21
This was referenced Mar 8, 2021
This was referenced Mar 10, 2021
y-yagi added a commit to y-yagi/pre-commit-golang that referenced this pull request Mar 29, 2021
`pre-commit` don't recommend to use a mutable reference to `rev` and
now shows a warning when `rev` is a mutable reference.
Ref: pre-commit/pre-commit#1715
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

issue a warning if a mutable ref is used (HEAD / stable / master / etc.)

2 participants