Skip to content

IgnoreReturnValue: config options#2712

Merged
schalkms merged 8 commits into
detekt:masterfrom
cortinico:ignore-return-value-followup
May 21, 2020
Merged

IgnoreReturnValue: config options#2712
schalkms merged 8 commits into
detekt:masterfrom
cortinico:ignore-return-value-followup

Conversation

@cortinico
Copy link
Copy Markdown
Member

@cortinico cortinico commented May 19, 2020

Follow-up to #2698: adding two config to the IgnoreReturnValue rule:

  • restrictToAnnotatedMethods: true to toggle the analysis only on annotated methods
  • returnValueAnnotations: ["*.CheckReturnValue", "*.CheckResult"] to provide a list of annotations to use during the inspection.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 19, 2020

Codecov Report

Merging #2712 into master will increase coverage by 0.03%.
The diff coverage is 85.71%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #2712      +/-   ##
============================================
+ Coverage     80.49%   80.52%   +0.03%     
- Complexity     2318     2322       +4     
============================================
  Files           378      378              
  Lines          6927     6944      +17     
  Branches       1257     1258       +1     
============================================
+ Hits           5576     5592      +16     
+ Misses          727      725       -2     
- Partials        624      627       +3     
Impacted Files Coverage Δ Complexity Δ
...turbosch/detekt/formatting/wrappers/Indentation.kt 100.00% <ø> (ø) 4.00 <0.00> (ø)
...ab/arturbosch/detekt/formatting/KtLintMultiRule.kt 91.66% <82.35%> (+3.91%) 7.00 <2.00> (+1.00)
...arturbosch/detekt/rules/bugs/IgnoredReturnValue.kt 84.09% <90.90%> (-2.76%) 12.00 <1.00> (+3.00) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update eb6291b...1719067. Read the comment docs.

cortinico and others added 4 commits May 20, 2020 10:38
…/bugs/IgnoredReturnValueSpec.kt

Co-authored-by: M Schalk <30376729+schalkms@users.noreply.github.com>
…/bugs/IgnoredReturnValue.kt

Co-authored-by: Brais Gabín <braisgabin@gmail.com>
@cortinico
Copy link
Copy Markdown
Member Author

Do we know what's happening with the build here? It seems to fail on the compilation of the test snippet. I'm not able to reproduce locally.

Moreover I see a failure in

ForbiddenPublicDataClassSpec > public data class inside an ignored package should pass config as string FAILED

That seems unrelated.

@BraisGabin
Copy link
Copy Markdown
Member

Do we know what's happening with the build here? It seems to fail on the compilation of the test snippet. I'm not able to reproduce locally.

You should be able to reproduce it with ./gradlew :detekt-rules:test -Pcompile-test-snippets=true. By default we don't compile the code snippets in local because it slow down the tests.

Moreover I see a failure in

ForbiddenPublicDataClassSpec > public data class inside an ignored package should pass config as string FAILED

That seems unrelated.

🤔 Maybe that test is flaky... strange.

@schalkms
Copy link
Copy Markdown
Member

I've already experienced this problem. It could occur because of conflicting package declarations or classes with the same name.

@schalkms schalkms merged commit 5926d84 into detekt:master May 21, 2020
@arturbosch arturbosch added this to the 1.10.0 milestone May 21, 2020
@cortinico cortinico deleted the ignore-return-value-followup branch June 13, 2020 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants