Modify default behavior to not output unless errors are found. Adding a verbose flag which will have legacy behavior#2258
Conversation
…rate into gradle plugin
Codecov Report
@@ Coverage Diff @@
## master #2258 +/- ##
============================================
- Coverage 81.45% 81.44% -0.01%
- Complexity 2114 2117 +3
============================================
Files 349 349
Lines 6054 6063 +9
Branches 1106 1109 +3
============================================
+ Hits 4931 4938 +7
Misses 532 532
- Partials 591 593 +2
Continue to review full report at Codecov.
|
schalkms
left a comment
There was a problem hiding this comment.
I have some questions. Please see my comments for that.
Anyway, I'm fine with changing the API here.
I'll add a second maintainer to the review list.
|
Cool, I had something similiar in mind, calling it |
|
I love this PR! I think that no output should be the default. And add As a bonus we can have the quiet mode |
That's a good idea! I agree with that. Then we should call the flag introduced with this PR |
…ut unless errors are present
|
Updated PR to default to no output unless error detekt should fail build or new flag |
| private fun handleConsoleReport(report: ConsoleReport, result: Detektion) { | ||
| report.print(settings.outPrinter, result) | ||
| if (settings.verbose || | ||
| config.maxIssues().isValidAndSmallerOrEqual(result.getOrComputeWeightedAmountOfIssues(config))) { |
There was a problem hiding this comment.
We only want to print something if the max issue count is exceeded, but here we just print something if the actual issue count is below the max, right?
|
Cool! Thanks for making these changes and bringing real value to our users. |
|
I would add If I don't use the
Probably we should show the summary "Build failed with 3178 weighted issues (threshold defined was 10)." But the time and the generated reports should not be there. What do you think? |
|
@BraisGabin I think we should keep it as simple as possible now. |
|
At least the -v should be added, I think. The other points can be fixed later. |
Agreed. |
|
I'm not really sure we need a We could achieve the same silent output when changing the |
Adding clli argument and gradle plugin functionality to enable verbose logging.
On our project we only want to log to console if an error occurs for cleaner logging,
Swapped default logic to not output unless errors present or verbose flag enabled