You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The autoupdate is trying to update the luacheck hook from v0.26.0 to latest. This is not ideal because latest is a moving target while v0.26.0 is fixed.
As of this writing, luacheck has three tags on the latest tagged release:
I inspected the autoupdate command and found the source of this issue at
I was able to replicate the behavior of this command in the pre-commit repo itself by adding a latest tag to the same SHA as v2.17.0.
git tag latest d3bdf1403d92f8cf2dc77bd99a5da42f0a6cef17
git describe --tags FETCH_HEAD --abbrev=0
latest
While git describe FETCH_HEAD --tags --abbrev=0 is elegant in its simplicity, it can only return a single tag, so it's limited in this multiple tags case.
Possible solution
pre-commit could look for the latest tag, then check to see if there are multiple tags on that SHA. If so, a tag could be preferred if it looks more "version-y." Maybe that's a semver style regex or something like that.
One of the tricks, I think, is to figure out how to check for multiple tags. I think the simplest way would be to get the output from tag_cmd and run that through git tag --points-at <tag_cmd output>. If there are multiple lines, then the version checking kind of stuff could occur.
Before trying this out, I wanted to check if this seems like a reasonable path or if there are other preferential ways to tackle this kind of thing.
pre-commit --version
pre-commit 2.17.0
.pre-commit-config.yaml
ci:
# The compilation time is too long so CI hits a timeout.skip: [luaformatter]repos:
- repo: https://github.com/lunarmodules/luacheckrev: "v0.26.0"hooks:
- id: luacheck
- repo: https://github.com/mblayman/LuaFormatterrev: "ad94bea01ca027ca46541af727e15d002aa5ce74"hooks:
- id: luaformatter
~/.cache/pre-commit/pre-commit.log (if present)
No response
The text was updated successfully, but these errors were encountered:
this is currently what pre-commit uses to consider a "version-y" string -- so that could probably be chosen preferentially (unless no such tag matches for the latest) --
describe your issue
I got an autoupdate PR from pre-commit.ci at https://github.com/mblayman/atlas/pull/29/files
The autoupdate is trying to update the luacheck hook from
v0.26.0
tolatest
. This is not ideal because latest is a moving target while v0.26.0 is fixed.As of this writing, luacheck has three tags on the latest tagged release:
I inspected the autoupdate command and found the source of this issue at
pre-commit/pre_commit/commands/autoupdate.py
Lines 40 to 43 in db44ad3
autoupdate basically runs
git describe FETCH_HEAD --tags --abbrev=0
. In the case of the luacheck repo, this returnslatest
.I was able to replicate the behavior of this command in the pre-commit repo itself by adding a
latest
tag to the same SHA asv2.17.0
.While
git describe FETCH_HEAD --tags --abbrev=0
is elegant in its simplicity, it can only return a single tag, so it's limited in this multiple tags case.Possible solution
pre-commit could look for the latest tag, then check to see if there are multiple tags on that SHA. If so, a tag could be preferred if it looks more "version-y." Maybe that's a semver style regex or something like that.
One of the tricks, I think, is to figure out how to check for multiple tags. I think the simplest way would be to get the output from
tag_cmd
and run that throughgit tag --points-at <tag_cmd output>
. If there are multiple lines, then the version checking kind of stuff could occur.Before trying this out, I wanted to check if this seems like a reasonable path or if there are other preferential ways to tackle this kind of thing.
pre-commit --version
pre-commit 2.17.0
.pre-commit-config.yaml
~/.cache/pre-commit/pre-commit.log (if present)
No response
The text was updated successfully, but these errors were encountered: