-
Couldn't load subscription status.
- Fork 470
feat(local): support resolving git packages that have a version specified #2209
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
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2209 +/- ##
==========================================
+ Coverage 67.68% 67.75% +0.07%
==========================================
Files 169 169
Lines 16273 16290 +17
==========================================
+ Hits 11014 11037 +23
+ Misses 4582 4576 -6
Partials 677 677 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Nice!
|
|
||
| func IsAffected(v osvschema.Vulnerability, pkg imodels.PackageInfo) bool { | ||
| for _, affected := range v.Affected { | ||
| // assume we're dealing with a git-source package whose name is the git repository, and that the version is the tag |
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.
Would it be clearer for this comment to be within the If statement? Right now it reads like the if statement is using the assumption, when I guess it's the other way around.
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.
Personally I tend to expect comments to be about the statement they precede, and that that tends to be the most common style - there's a number of small factors for that such as the comment is usually explaining the condition rather than the implementation, and editor folding of the content in the braces hides the comment which I find is typically counter to having the comment.
In this case, most of the comment is describing the top if condition, ending with describing what the condition being satisfied means we can do (which assumingly then takes place in the body), so I think it's valid where it is
| continue | ||
| } | ||
|
|
||
| eco = "GIT" |
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'm surprised this just compiles without casting?
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.
ha yeah I was surprised too - technically it makes sense because the type is a string rather than a "enum" even though it gets used in that fashion, so I'm guessing this is triggering an implicit cast that succeeds because the right hand side is a string 🤷
(in fact, if I add the cast it gets marked as redundant)
bddc392 to
2b72697
Compare
9e66ee0 to
755253e
Compare
Resolves #2014