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

Fix ModifierOrder for false positive reported by ModifierOrder when using fun interfaces #3051

Merged
merged 2 commits into from
Sep 5, 2020

Conversation

chao2zhang
Copy link
Member

@chao2zhang chao2zhang commented Sep 5, 2020

This fixes #3050

Most of the modifiers in ModifierOrder.order are not compatible with the interface, but fun is a modifier. Hence the change is to append fun in the list after the visibility and expected/actual.

I have also added a negative test case. The positive test case of mixing a visibility modifier and another modifier is likely to be fabricated and does not work in an actual project.

For ./gradlew build -x dokka and ./gradlew detekt, both passed locally.

@codecov
Copy link

codecov bot commented Sep 5, 2020

Codecov Report

Merging #3051 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #3051   +/-   ##
=========================================
  Coverage     79.31%   79.31%           
  Complexity     2562     2562           
=========================================
  Files           432      432           
  Lines          7725     7726    +1     
  Branches       1466     1466           
=========================================
+ Hits           6127     6128    +1     
  Misses          814      814           
  Partials        784      784           
Impacted Files Coverage Δ Complexity Δ
...lab/arturbosch/detekt/rules/style/ModifierOrder.kt 100.00% <100.00%> (ø) 3.00 <0.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 c08de81...1640cde. Read the comment docs.

@schalkms schalkms merged commit ab76be9 into detekt:master Sep 5, 2020
@arturbosch arturbosch added this to the 1.13.0 milestone Sep 7, 2020
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.

False positive reported by ModifierOrder when using fun interfaces
4 participants