-
Notifications
You must be signed in to change notification settings - Fork 416
Add support for verbosity levels #727
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 ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #727 +/- ##
==========================================
+ Coverage 78.35% 78.65% +0.29%
==========================================
Files 85 86 +1
Lines 6044 6109 +65
==========================================
+ Hits 4736 4805 +69
+ Misses 1103 1098 -5
- Partials 205 206 +1 ☔ View full report in Codecov by Sentry. |
7bb2465
to
251ccc9
Compare
Not sure if I resolved all the problem lines that Codecov complained about as it has been silent with my recent force pushes; making this PR ready for review |
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.
Thanks! Overall looks good to me.
I just merged #722 which would have caused some conflicts, should be straightforward to resolve as it only removes unused print functions. |
b392107
to
acf6f30
Compare
I believe I made all the necessary changes. I also changed some of the |
acf6f30
to
73dbd6b
Compare
Recent change has pkg/reporter/gh-annotations_reporter_test.go create the correct reporter (was creating JSONReporter). It does seem like there is a lot of test code duplication; let me know if this may be a problem |
Also just realized that the CodeCov bot just modifies its comment when I make changes to my branch instead of creating a new comment. Since the changes I made to the reporter has also changed older areas of the codebase, it is complaining about these areas not being covered. Not sure what I should do; should I try to write coverage tests for these older areas? |
No need, as long as the new code has good coverage you're good, and it looks like it does :). |
Yeah it is quite a bit of duplication, I think eventually we want to decouple the results reporting from the general info/warn/err printing, but that is something for V2. For now I don't have any ideas for reducing this without over complicating the tests. |
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.
ooh love getting a new bikeshed for me to lure people into through follow up PRs :D
Just got a bug to fix and a recommended change, and then this should be good to go - I'm also pretty sure I know a clean way to deduplicate the tests, but it's not that important
2e4e9e0
to
daff216
Compare
(Recent change updates some of my test error messages that are out-of-date) |
daff216
to
28dc2da
Compare
28dc2da
to
d4f9c9d
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.
Looks good to me, though it'd be great if you could chuck in a couple of basic CLI tests (cmd/osv-scanner/main_test.go
) with different verbosity levels - among other things, that'll catch if setting HasErrored
is ever mucked up
Sure thing, making the changes now |
d4f9c9d
to
3ea26cd
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.
Thanks!
Update govet printf settings for #727
Inspired by what was discussed in #698, this PR makes the necessary (breaking) changes to the
reporter
package such that theReporter
interface now provides methods for printing at certain levels (i.e. ErrorLevel, WarnLevel, InfoLevel, and VerboseLevel). It also adds a --verbosity option so that users/automated tools can take advantage of this too.