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 now throws a warning when targeting a specific branch #45

Open
ptrbrynt opened this issue Feb 11, 2021 · 5 comments
Open

Pre-commit now throws a warning when targeting a specific branch #45

ptrbrynt opened this issue Feb 11, 2021 · 5 comments
Labels
bug Something isn't working

Comments

@ptrbrynt
Copy link

Describe the bug

When running pre-commit with this config:

repos:
  - repo: https://github.com/fluttercommunity/import_sorter
    rev: "master"
    hooks:
      - id: flutter-import-sorter

A warning is thrown:

[WARNING] The 'rev' field of repo 'https://github.com/fluttercommunity/import_sorter' appears to be a mutable reference (moving tag / branch).  Mutable references are never updated after first install and are not supported.  See https://pre-commit.com/#using-the-latest-version-for-a-repository for more details.

Expected behavior

I would like a tag to be added to GitHub which I can reference in my pre-commit config.

Meta Information:

  • Dart Version: 2.10.5
  • import_sorter Version: master
  • Is it a Flutter project? Yes
  • What version of Flutter are you using (if flutter project): 1.22.6
@ptrbrynt ptrbrynt added the bug Something isn't working label Feb 11, 2021
@github-actions
Copy link

👋 Hello! Thanks for submitting a issue! @Matt-Gleich will try to respond as soon as possible.

@gleich
Copy link
Member

gleich commented Feb 11, 2021

@lig any idea why this might be going on?

@lig
Copy link
Contributor

lig commented Feb 11, 2021

@Matt-Gleich I'll try to look into this a bit later

@lig
Copy link
Contributor

lig commented Feb 12, 2021

So, according to pre-commit docs, this is by pre-commit design for mutable git references, aka branch references.

@Matt-Gleich Using tags in the import_sorter repo would be beneficial for pre-commit hooks as it will allow using tags instead of the master reference in pre-commit configs.

@ptrbrynt as a workaround, I recommend following pre-commit docs advice and use --bleeding-edge argument for pre-commit autoupdate, i.e.

pre-commit autoupdate --bleeding-edge --repo https://github.com/fluttercommunity/import_sorter

This should point the revision to the latest commit hash in master instead of referencing master by mutable named reference.

@gleich
Copy link
Member

gleich commented Dec 7, 2021

See #63

@gleich gleich closed this as completed Dec 7, 2021
@gleich gleich reopened this Dec 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants