question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unexpected version picked by pre-commit autoupdate

See original GitHub issue

describe your issue

Hello! I’m setting up pre-commit for a terraform repo I’m working on, and I want to integrate https://github.com/bridgecrewio/checkov as a hook. This tool already has a pre-commit config file, so this should be pretty straightforward.

The strange behavior I seem to be running into is that when I run pre-commit autoupdate instead of updating to what seems to be the latest tagged release - https://github.com/bridgecrewio/checkov/releases/tag/2.0.780 - it’s instead updating to an older tagged release - https://github.com/bridgecrewio/checkov/releases/tag/1.0.505 - and I don’t quite understand why.

For example, if I manually set a newer tag and then run autoupdate:

pre-commit autoupdate
Updating https://github.com/pre-commit/pre-commit-hooks ... [INFO] Initializing environment for https://github.com/pre-commit/pre-commit-hooks.
updating v3.2.0 -> v4.1.0.
Updating https://github.com/oasys/checkov ... [INFO] Initializing environment for https://github.com/oasys/checkov.
updating 2.0.780 -> 1.0.505.

This just seems odd, though of course it’s possible (or likely) that I’m simply not understanding something, or using the tool incorrectly. Thank you for taking a look!

pre-commit --version

pre-commit 2.17.0

.pre-commit-config.yaml

# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
-   repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v4.1.0
    hooks:
    -   id: trailing-whitespace
    -   id: end-of-file-fixer
    -   id: check-yaml
    -   id: check-added-large-files
- repo: https://github.com/oasys/checkov
  rev: 1.0.505
  hooks:
  - id: checkov
    verbose: true

~/.cache/pre-commit/pre-commit.log (if present)

<not present>

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
guykiselcommented, Feb 2, 2022

Confirmed that was the issue:

pre-commit autoupdate
Updating https://github.com/pre-commit/pre-commit-hooks ... already up to date.
Updating https://github.com/bridgecrewio/checkov ... [INFO] Initializing environment for https://github.com/bridgecrewio/checkov.
updating 1.0.505 -> 2.0.780.

So I’m all set. Oops.

1reaction
guykiselcommented, Feb 2, 2022

Oh, wow. Definitely a facepalm moment, I grabbed the config from the example in the original PR at https://github.com/bridgecrewio/checkov/pull/522 which must have been based on the author’s fork. Which totally explains the tag discrepancy. Thanks so much, I totally missed that.

Read more comments on GitHub >

github_iconTop Results From Across the Web

pre-commit
A framework for managing and maintaining multi-language pre-commit hooks. ... If you're using an old version of pre-commit, the top-level list is the...
Read more >
pre-commit giving error with mirrors-mypy, how do I fix it?
I am using Ubuntu 22.04. In short, when I try git commit, it will report an error because I have installed pre-commit :...
Read more >
pre-commit.ci
automatic updates : pre-commit.ci will periodically autoupdate your configuration ensuring that your hook versions are kept up to date. this autoupdate is ...
Read more >
157 - pre-commit - Anthony Sottile | pythontest - Brian Okken
So you can run precommitted auto update, and it'll just take the versions that you've encoded into your config file and dump those...
Read more >
pre-commit Changelog - pyup.io
Have autoupdate preferentially pick tags which look like versions when ... written in older versions, but pre-commit itself requires python 3.7+.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found