-
-
Notifications
You must be signed in to change notification settings - Fork 758
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
Throw error instead of logging as error in analysis phase #3193
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3193 +/- ##
============================================
+ Coverage 79.84% 80.05% +0.21%
- Complexity 2610 2613 +3
============================================
Files 439 439
Lines 7953 7953
Branches 1516 1516
============================================
+ Hits 6350 6367 +17
+ Misses 790 774 -16
+ Partials 813 812 -1
Continue to review full report at Codecov.
|
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 for this PR. This one looks good. I think the mentioned improvements should be tackled in a subsequent PR. What do you think? May I ask you to please create an issue containing this improvement for tracking purposes?
detekt-tooling/src/main/kotlin/io/github/detekt/tooling/api/DetektError.kt
Outdated
Show resolved
Hide resolved
detekt-core/src/main/kotlin/io/gitlab/arturbosch/detekt/core/Analyzer.kt
Outdated
Show resolved
Hide resolved
See #3183. This PR is already linked to the issue aforementioned. |
detekt-core/src/main/kotlin/io/gitlab/arturbosch/detekt/core/Analyzer.kt
Outdated
Show resolved
Hide resolved
detekt-core/src/main/kotlin/io/gitlab/arturbosch/detekt/core/Analyzer.kt
Outdated
Show resolved
Hide resolved
* Throw error instead of logging as error in analysis phase * Refactor to use IllegalStateException * Revert DetektError change
* Throw error instead of logging as error in analysis phase * Refactor to use IllegalStateException * Revert DetektError change
* Throw error instead of logging as error in analysis phase * Refactor to use IllegalStateException * Revert DetektError change
* Throw error instead of logging as error in analysis phase * Refactor to use IllegalStateException * Revert DetektError change
This PR addresses #3183
A few changes worth calling out:
Junk.kt
to private elementsAnalyzer.kt
Detektor
appears toAnalyzer
. Introduce tooling api module #2861 renamed the class fromDetektor
toAnalyzer
but did not update all references like variable names.With this PR, users will see the following output in the console:
There is one more usage of
LoggingAware.error()
, although tangential to this PR, it would be great to removeLoggingAware.error()
because logging as an error is not treating the severity correctly. When an exception happens, we should surface the error back to the user rather than logging and telling the user that the command completed successfully.