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

UndocumentedPublicProperty doesn't check primary constructor #2468

Closed
mrf7 opened this issue Mar 19, 2020 · 0 comments · Fixed by #2475
Closed

UndocumentedPublicProperty doesn't check primary constructor #2468

mrf7 opened this issue Mar 19, 2020 · 0 comments · Fixed by #2475

Comments

@mrf7
Copy link

mrf7 commented Mar 19, 2020

Expected Behavior

If a property is declared in the primary constructor (especially in a data class), the static analysis should count an issue if the property isn't documented.

Observed Behavior

Only properties declared in the class body are flagged when left public and undocumented.

Steps to Reproduce

Create a class with properties declared in the primary constructor but don't add @property or KDoc reference in a comment

Context

Your Environment

  • Version of detekt used: 1.6.0
  • Operating System and version: OSX
schalkms added a commit that referenced this issue Mar 21, 2020
* Check primary ctor in UndocumentedPublicProperty

Closes #2468

* Add test case for an undocumented property

* Add test case for non-public property

* Check for val + var declaration on ctor parameters

This has to be done in order to not flag the following use case.
isPublicNotOverridden() returns true even though it's not public.

class Test(a: Int)
@arturbosch arturbosch added this to the 1.7.0 milestone Mar 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants