Navigation Menu

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

added warning if mutable rev is used #1715

Merged
merged 1 commit into from Dec 18, 2020
Merged

added warning if mutable rev is used #1715

merged 1 commit into from Dec 18, 2020

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'}

pre_commit/clientlib.py Outdated Show resolved Hide resolved
pre_commit/clientlib.py Outdated Show resolved Hide resolved
pre_commit/clientlib.py Outdated Show resolved Hide resolved
pre_commit/clientlib.py Outdated Show resolved Hide resolved
pre_commit/clientlib.py Outdated Show resolved Hide resolved
pre_commit/clientlib.py Outdated Show resolved Hide resolved
pre_commit/clientlib.py Outdated Show resolved Hide resolved
tests/clientlib_test.py Outdated Show resolved Hide resolved
pre_commit/clientlib.py Outdated Show resolved Hide resolved
pre_commit/clientlib.py Outdated Show resolved Hide resolved
pre_commit/clientlib.py Outdated Show resolved Hide resolved
pre_commit/clientlib.py Outdated Show resolved Hide resolved
pre_commit/clientlib.py Outdated Show resolved Hide resolved
pre_commit/clientlib.py Outdated Show resolved Hide resolved
tests/clientlib_test.py Outdated Show resolved Hide resolved
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