-
-
Notifications
You must be signed in to change notification settings - Fork 767
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
UndocumentedPublicClass false positive for inner types #2580
Comments
I think that we don't even need |
Thanks for reporting this. class Outer(val i: Int) {
// must be documented
class Nested(val s: String) {
}
} |
Mmmh. Yes they do... There is even explicit config for it. The documentation says:
And, yes your example should and is flagged. As far as I can see, that works as expected. The problem is only when the outer class is not public. |
* Fix false positives in UndocumentedPublicProperty Properties in classes that are nested, public and undocumented are not flagged by this rule anymore. Related #2580 * Fix detekt warning * Remove unnecessary test
* Fix false positive in UndocumentedPublicClass Classes that are nested, non-public and undocumented are not flagged by this rule anymore. Closes #2580 * Fix detekt issue
Expected Behavior
Given the following source code:
I don't expect the
UndocumentedPublicClass
to be reported becauseMyClass
is private.Yes
MyInnerObject
is not explicitly marked private. But being an inner type of a private one, makesMyInnerObject
effectively private.Observed Behavior
Given the snippet above and the rule
UndocumentedPublicClass
activated:A
UndocumentedPublicClass
issue is reported, saying thatMyInnerObject
is public and undocumented.Steps to Reproduce
The snippets above should be enough to reproduce the issue.
Context
I added a private class with inner types and got the mentioned false-positive reported by detekt.
Your Environment
1.7.4
6.3
Linux 5.5.13
The text was updated successfully, but these errors were encountered: