-
Notifications
You must be signed in to change notification settings - Fork 66
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
Enable Detekt #522
Enable Detekt #522
Conversation
Signed-off-by: Rupal Mahajan <maharup@amazon.com>
Codecov Report
@@ Coverage Diff @@
## main #522 +/- ##
============================================
+ Coverage 74.46% 76.85% +2.39%
============================================
Files 94 30 -64
Lines 4022 1923 -2099
Branches 641 412 -229
============================================
- Hits 2995 1478 -1517
+ Misses 893 442 -451
+ Partials 134 3 -131
Flags with carried forward coverage won't be shown. Click here to find out more. Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
@@ -25,7 +25,8 @@ internal object SecurityAccess { | |||
return try { | |||
AccessController.doPrivileged(operation) | |||
} catch (e: PrivilegedActionException) { | |||
throw (e.cause as Exception?)!! | |||
var exception = e | |||
throw (exception.cause as Exception?)!! |
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.
why this change? if it's variable naming maybe change to } catch (exception: PrivilegedActionException) {
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.
Build was failing with SwallowedException here.
This rule reports all instances where exceptions are caught and not correctly passed (e.g. as a cause) into a newly thrown exception.
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.
you can use suppress @Suppress("SwallowedException")
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.
kk. Thanks. added suppress.
Signed-off-by: Rupal Mahajan <maharup@amazon.com>
Signed-off-by: Rupal Mahajan <maharup@amazon.com> (cherry picked from commit 5e3047d)
Signed-off-by: Rupal Mahajan maharup@amazon.com
Description
Enable Detekt with upgraded version 1.22.0-RC2.
Issues Resolved
#520
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.