Skip to content

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

Merged
merged 2 commits into from
Dec 12, 2023

Conversation

terriko
Copy link
Contributor

@terriko terriko commented Nov 30, 2023

Coverity was warning about unreachable code because I forgot to put in an if statement.

Coverity was warning about unreachable code because I forgot to put in
an if statement.

Signed-off-by: Terri Oda <[email protected]>
@codecov-commenter
Copy link

codecov-commenter commented Nov 30, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (f2df248) 78.10% compared to head (b41fa23) 78.39%.
Report is 24 commits behind head on main.

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     
Flag Coverage Δ
win-longtests 78.39% <100.00%> (+0.29%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -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

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.

Copy link
Contributor Author

@terriko terriko Dec 12, 2023

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?

@terriko terriko merged commit 677400e into intel:main Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants