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

False positive for unused imports #4815 #4818

Merged
merged 2 commits into from May 9, 2022
Merged

Conversation

themkat
Copy link
Contributor

@themkat themkat commented May 7, 2022

Handle all kdoc sections in UnusedImports, not just the first one. The KDoc method getDefaultSection only gets the first section of the KDoc (text before an empty line). This fix now checks all sections/paragraphs of a KDoc instead.

Fixes #4815

@github-actions github-actions bot added the rules label May 7, 2022
@codecov
Copy link

codecov bot commented May 7, 2022

Codecov Report

Merging #4818 (5fc74c4) into main (d0d34c1) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@             Coverage Diff              @@
##               main    #4818      +/-   ##
============================================
+ Coverage     84.71%   84.73%   +0.01%     
  Complexity     3431     3431              
============================================
  Files           491      491              
  Lines         11267    11267              
  Branches       2075     2073       -2     
============================================
+ Hits           9545     9547       +2     
  Misses          673      673              
+ Partials       1049     1047       -2     
Impacted Files Coverage Δ
...lab/arturbosch/detekt/rules/style/UnusedImports.kt 89.87% <100.00%> (+2.53%) ⬆️

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 d0d34c1...5fc74c4. Read the comment docs.

@cortinico cortinico added this to the 1.21.0 milestone May 9, 2022
@chao2zhang chao2zhang merged commit 463fbf1 into detekt:main May 9, 2022
@themkat themkat deleted the GH-4815 branch May 9, 2022 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

False positive for unused imports
4 participants