-
-
Notifications
You must be signed in to change notification settings - Fork 802
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
fix for dotnet hooks with prefixes #2641
Conversation
pre_commit/languages/dotnet.py
Outdated
# https://learn.microsoft.com/en-us/nuget/concepts/package-versioning#version-basics | ||
tool_name_re = re.compile(r'(.*)\.\d+\.\d+\.\d+(-.*)?\.nupkg') | ||
|
||
build_outputs = os.listdir(os.path.join(prefix.prefix_dir, build_dir)) | ||
for output in build_outputs: | ||
tool_name = output.split('.')[0] | ||
|
||
tool_name_match = tool_name_re.match(output) | ||
assert tool_name_match | ||
tool_name = tool_name_match.group(1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems fragile -- can we read the name out of the metadata itself? or install the .nupkg
file directly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've committed a version which reads the xml from the nupkg (zip file), but it needs tidied up a bit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There might be a way to simplify it, but this version seems to work.
46af90f
to
909f1b3
Compare
909f1b3
to
e904628
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Recreated from #2630)
Fixes #2629