-
-
Notifications
You must be signed in to change notification settings - Fork 712
fixed bug no version detected in pre-commit installation #1283
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
base: main
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,3 +18,7 @@ | |
|
|
||
| __author__ = metadata.metadata("bandit")["Author"] | ||
| __version__ = metadata.version("bandit") | ||
| # __version__ = metadata.version(__package__) | ||
| # running bandit inside pre-commit we do not get a version here, workaround: | ||
| if __version__ == "0.0.0": | ||
| __version__ = "latest" | ||
|
Comment on lines
+21
to
+23
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems a bit hacky. I'd rather we get to the root cause on why the semver doesn't get into pre-commit.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree. This seems like a bug where this is hiding that bug rather than fixing it.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My guess is this is a
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, this is a workaround. After init_repo follows pre-commit clone_strategy and does something like this: p="$(mktemp -d --tmpdir "$HOME"/.cache/pre-commit/)"
cd "$p"
git init .
git init
git remote add origin https://github.com/PyCQA/bandit
git fetch origin 1.8.5 --depth=1
git checkout FETCH_HEADAnd the repo has no version info. Neither the working tree nor the I think a clean solution here would be to define the version in |
||
Uh oh!
There was an error while loading. Please reload this page.