-
Notifications
You must be signed in to change notification settings - Fork 544
fix: improve version_compare logic #3548
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
Conversation
Coverity was warning about unreachable code because I forgot to put in an if statement. Signed-off-by: Terri Oda <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3548 +/- ##
==========================================
+ Coverage 78.10% 78.39% +0.29%
==========================================
Files 761 765 +4
Lines 11560 11600 +40
Branches 1356 1362 +6
==========================================
+ Hits 9029 9094 +65
+ Misses 2109 2089 -20
+ Partials 422 417 -5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
cve_bin_tool/version_compare.py
Outdated
@@ -140,10 +140,14 @@ def version_compare(v1: str, v2: str): | |||
# Honestly it's hard to guess if .dev3 is going to be more or less than .rc4 | |||
# unless you know the project, so hopefully people don't expect that kind of range | |||
# matching |
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.
Maybe just me having a hard time with regular expressions, but the simplest way to follow the code is by internalizing the first comment that you have here ("They're both of type...") while the second one ("Honestly it's hard...") distracts me. I know this is nitpicking, but I with switch the order of those two comments and leave the one relative to the code immediately before the code.
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.
@antoniogi I think it's more clear if I explain what happens, so I changed this comment. Do you mind re-reading it and seeing if it actually helps make things more clear?
Signed-off-by: Terri Oda <[email protected]>
Coverity was warning about unreachable code because I forgot to put in an if statement.