Skip to content
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

Merged
merged 2 commits into from
Oct 28, 2022
Merged

Enable Detekt #522

merged 2 commits into from
Oct 28, 2022

Conversation

rupal-bq
Copy link
Contributor

Signed-off-by: Rupal Mahajan maharup@amazon.com

Description

Enable Detekt with upgraded version 1.22.0-RC2.

Issues Resolved

#520

Check List

  • New functionality includes testing.
    • All tests pass, including unit test, integration test and doctest
  • New functionality has been documented.
    • New functionality has javadoc added
    • New functionality has user manual doc added
  • Commits are signed per the DCO using --signoff

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.

Signed-off-by: Rupal Mahajan <maharup@amazon.com>
@rupal-bq rupal-bq requested a review from a team as a code owner October 28, 2022 18:45
@codecov-commenter
Copy link

codecov-commenter commented Oct 28, 2022

Codecov Report

Merging #522 (2617eee) into main (5fced6c) will increase coverage by 2.39%.
The diff coverage is n/a.

@@             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     
Flag Coverage Δ
dashboards-reports 76.85% <ø> (ø)
reports-scheduler ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...h/reportsscheduler/index/ReportDefinitionsIndex.kt
...rch/reportsscheduler/index/ReportInstancesIndex.kt
...nsearch/reportsscheduler/model/ReportDefinition.kt
...search/reportsscheduler/security/SecurityAccess.kt
...search/reportsscheduler/settings/PluginSettings.kt
...ler/resthandler/ReportDefinitionListRestHandler.kt
...sscheduler/model/UpdateReportDefinitionResponse.kt
...earch/reportsscheduler/metrics/RollingCounter.java
...tsscheduler/action/UpdateReportDefinitionAction.kt
...n/org/opensearch/reportsscheduler/model/RestTag.kt
... and 54 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?)!!
Copy link
Member

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) {

Copy link
Contributor Author

@rupal-bq rupal-bq Oct 28, 2022

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.

Copy link
Member

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")

Copy link
Contributor Author

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>
@joshuali925 joshuali925 merged commit 5e3047d into opensearch-project:main Oct 28, 2022
opensearch-trigger-bot bot pushed a commit that referenced this pull request Oct 28, 2022
Signed-off-by: Rupal Mahajan <maharup@amazon.com>
(cherry picked from commit 5e3047d)
@rupal-bq rupal-bq deleted the main-detekt-version-upgrade branch November 28, 2022 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants