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

Add KDoc for convoluted PathFilters.isIgnored #3312

Merged
merged 4 commits into from
Dec 20, 2020

Conversation

chao2zhang
Copy link
Member

#3279 describes the scenario that rules are not doing anything if neither includes or excludes are specified.

When reading the code, it comes to me that PathFilters.isIgnored() is a bit convoluted and probably the implementation is not working as expected. Therefore I publish this PR to describe the current behavior. And in case we update the behavior later, we should be able to correct the doc and help the reviewers to understand the status quo.

@codecov
Copy link

codecov bot commented Dec 20, 2020

Codecov Report

Merging #3312 (61ab71c) into master (2a2d756) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #3312   +/-   ##
=========================================
  Coverage     80.02%   80.02%           
  Complexity     2673     2673           
=========================================
  Files           443      443           
  Lines          8130     8130           
  Branches       1545     1545           
=========================================
  Hits           6506     6506           
  Misses          796      796           
  Partials        828      828           
Impacted Files Coverage Δ Complexity Δ
...tlab/arturbosch/detekt/api/internal/PathFilters.kt 88.00% <ø> (ø) 4.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 2a2d756...9463f07. Read the comment docs.

Copy link
Member

@schalkms schalkms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good one! Thank you.
Could we also add this phenomenal comment to the test description in PathFiltersSpec.kt? I think this will be beneficial for future readers of the code to have a test for each case.

Bonus (test) case: have the same path included as well as excluded

@chao2zhang
Copy link
Member Author

Good one! Thank you.
Could we also add this phenomenal comment to the test description in PathFiltersSpec.kt? I think this will be beneficial for future readers of the code to have a test for each case.

Bonus (test) case: have the same path included as well as excluded

I added the test case as another form of documentation

@schalkms schalkms merged commit 8bab38b into detekt:master Dec 20, 2020
@chao2zhang chao2zhang deleted the filters-doc branch December 20, 2020 23:43
@BraisGabin BraisGabin added the housekeeping Marker for housekeeping tasks and refactorings label Dec 27, 2020
@BraisGabin BraisGabin added this to the 1.16.0 milestone Dec 27, 2020
arturbosch pushed a commit that referenced this pull request Jan 16, 2021
* Add KDoc for convoluted PathFilters.isIgnored

* Add tests for convoluted PathFilters.isIgnored

* Fix NoConsecutiveBlankLines

* Fix conjugation in description
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
housekeeping Marker for housekeeping tasks and refactorings
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants