-
-
Notifications
You must be signed in to change notification settings - Fork 756
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
Suppress RedundantVisibilityModifierRule if explicit API mode enabled #3175
Conversation
Explicit API mode was added in Kotlin 1.4 It prevents libraries' authors from making APIs public unintentionally. In this mode, the visibility modifier should be defined explicitly even if it is public. See: https://kotlinlang.org/docs/reference/whatsnew14.html#explicit-api-mode-for-library-authors Closes #3125
Codecov Report
@@ Coverage Diff @@
## master #3175 +/- ##
============================================
+ Coverage 79.44% 79.56% +0.11%
- Complexity 2596 2611 +15
============================================
Files 437 439 +2
Lines 7818 7937 +119
Branches 1484 1512 +28
============================================
+ Hits 6211 6315 +104
- Misses 819 820 +1
- Partials 788 802 +14 Continue to review full report at Codecov.
|
@@ -53,11 +55,21 @@ class RedundantVisibilityModifierRule(config: Config = Config.empty) : Rule(conf | |||
|
|||
private fun KtModifierListOwner.isExplicitlyPublic() = this.hasModifier(KtTokens.PUBLIC_KEYWORD) | |||
|
|||
/** | |||
* Explicit API mode was added in Kotlin 1.4 |
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 add a note in the KDoc on top of the file so it gets propagated in the generated documentation?
Thank you for making this change. I meant to report a new issue but found that this is already addressed! |
…#3175) * Suppress RedundantVisibilityModifierRule if explicit API mode enabled Explicit API mode was added in Kotlin 1.4 It prevents libraries' authors from making APIs public unintentionally. In this mode, the visibility modifier should be defined explicitly even if it is public. See: https://kotlinlang.org/docs/reference/whatsnew14.html#explicit-api-mode-for-library-authors Closes #3125 * Add explicit API mode to rule documentation
…#3175) * Suppress RedundantVisibilityModifierRule if explicit API mode enabled Explicit API mode was added in Kotlin 1.4 It prevents libraries' authors from making APIs public unintentionally. In this mode, the visibility modifier should be defined explicitly even if it is public. See: https://kotlinlang.org/docs/reference/whatsnew14.html#explicit-api-mode-for-library-authors Closes #3125 * Add explicit API mode to rule documentation
…#3175) * Suppress RedundantVisibilityModifierRule if explicit API mode enabled Explicit API mode was added in Kotlin 1.4 It prevents libraries' authors from making APIs public unintentionally. In this mode, the visibility modifier should be defined explicitly even if it is public. See: https://kotlinlang.org/docs/reference/whatsnew14.html#explicit-api-mode-for-library-authors Closes #3125 * Add explicit API mode to rule documentation
Explicit API mode was added in Kotlin 1.4
It prevents library authors from making APIs public unintentionally.
In this mode, the visibility modifier should be defined explicitly even if it is public.
See: https://kotlinlang.org/docs/reference/whatsnew14.html#explicit-api-mode-for-library-authors
Closes #3125