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 reported for documented data classes property #2529

Closed
jcornaz opened this issue Mar 27, 2020 · 1 comment · Fixed by #2530
Closed

UndocumentedPublicProperty reported for documented data classes property #2529

jcornaz opened this issue Mar 27, 2020 · 1 comment · Fixed by #2530

Comments

@jcornaz
Copy link

jcornaz commented Mar 27, 2020

Expected Behavior

The following code:

/**
 * @property prop1 The property is documented
 */
data class MyDataClass(val prop1: String)

should not see any UndocumentedPublicProperty being reported because all properties are documented.

Observed Behavior

Running detekt reports an issue:

UndocumentedPublicProperty - [prop1] at /home/me/workspace/project/src/main/kotlin/Example.kt:8:24

Steps to Reproduce

The code above is all you need to reproduce the issue.

Context

I was trying to update detekt from 1.6.0 to 1.7.1 and I got this errors. But I cannot fix them, because the properties are already documented.

Your Environment

@schalkms
Copy link
Member

Ugh, this slip through, unfortunately. Sorry for the inconvenience. Thanks for reporting it though.
With 1.7.1 a bug concerning undocumented properties that were not documented was fixed.
I think we should be a bit more conservative here and also allow @param in addition to @property.

arturbosch pushed a commit that referenced this issue Mar 28, 2020
* Fix report for documented data classes property

A documented property should not be reported as undocumented by the UndocumentedPublicProperty rule.

This closes #2529

* Fix ChainWrapping issue in code
@arturbosch arturbosch added this to the 1.7.2 milestone Mar 28, 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