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 #3125
Comments
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
…#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
Not fixed in 1.15.0 |
Looks like the value in AnalysisFlags, used to get explicitMode is default value, so it is always |
Thanks for checking this feature thoroughly. |
…#3358) * Suppress RedundantVisibilityModifierRule if explicit API mode enabled This solution uses the languageVersionSettings of the compiler to fetch the API mode setting. 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 * Declare variables in Spec as memoized
…#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
…#3358) * Suppress RedundantVisibilityModifierRule if explicit API mode enabled This solution uses the languageVersionSettings of the compiler to fetch the API mode setting. 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 * Declare variables in Spec as memoized
Expected Behavior of the rule
If explicit API mode is enabled:
Detekt should suppress
RedundantVisibilityModifierRule
forpublic
modifier.Context
Explicit API mode was added in Kotlin 1.4
It prevents libraries' authors from making APIs public unintentionally. In this mode, you should explicitly specify the visibility modifier even if it is
public
.The text was updated successfully, but these errors were encountered: