-
-
Notifications
You must be signed in to change notification settings - Fork 771
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
Remove exceptions of Library rules #3304
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3304 +/- ##
=========================================
Coverage 80.32% 80.33%
+ Complexity 2721 2712 -9
=========================================
Files 445 445
Lines 8168 8171 +3
Branches 1553 1553
=========================================
+ Hits 6561 6564 +3
Misses 774 774
Partials 833 833
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this idea! The three rules changed their behavior, so this should be documented for the next release. Furthermore, I think all three rules could be activated by default.
...tyle/src/test/kotlin/io/gitlab/arturbosch/detekt/rules/style/ForbiddenPublicDataClassSpec.kt
Outdated
Show resolved
Hide resolved
...tyle/src/test/kotlin/io/gitlab/arturbosch/detekt/rules/style/ForbiddenPublicDataClassSpec.kt
Show resolved
Hide resolved
@@ -554,6 +554,7 @@ style: | |||
methods: ['kotlin.io.println', 'kotlin.io.print'] | |||
ForbiddenPublicDataClass: | |||
active: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should activate all three rules. With the exclude filter set by default nothing gets flagged, so this is fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I activated them as you said but I'm not sure about this. This are rules only for library developers. Even if we exclude all the files it seems like rules that should be disabled by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's see what the community thinks about it.
.../test/kotlin/io/gitlab/arturbosch/detekt/rules/style/LibraryCodeMustSpecifyReturnTypeSpec.kt
Show resolved
Hide resolved
.../test/kotlin/io/gitlab/arturbosch/detekt/rules/style/LibraryEntitiesShouldNotBePublicTest.kt
Show resolved
Hide resolved
@BraisGabin sorry for my late review. This PR went under my radar, unfortunately. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All questions are solved. Thanks! PR looks good to me.
Closes #3279 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be clearer for the user, good thoughts!
* Fix typo * exclude all files in our library rules by default * Active ForbiddenPublicDataClass and LibraryEntitiesShouldNotBePublic by default
We had this code to make our 3 library rules behave different. But our users don't understand that #3215.
With this PR I change those rules to behave as any other rule but changing their default configuration so the users can see what's going on.
This is an alternative implementation of #3279
I did disable the rule LibraryCodeMustSpecifyReturnType by default too.