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

A generic type parameter in Kdoc should not be reported #1929

Open
polarene opened this issue Apr 8, 2024 · 4 comments
Open

A generic type parameter in Kdoc should not be reported #1929

polarene opened this issue Apr 8, 2024 · 4 comments
Labels
bug Something isn't working good first issue Good for newcomers
Milestone

Comments

@polarene
Copy link

polarene commented Apr 8, 2024

Describe the bug

When documenting a type parameter in Kdoc, the only correct way to do it is using the @param tag, for example:

/**
 * @param T the target type to return
 */
fun <T> genericFunc(): T

Unfortunately Diktat reports:

[KDOC_WITHOUT_PARAM_TAG] all methods which take arguments should have @param tags in KDoc: T param isn't present in argument list

Which I believe is a wrong behavior, given that it's taking into consideration the formal parameters only.

Expected behavior

Diktat should not report a violation for the above example.

Observed behavior

Diktat reports a KDOC_WITHOUT_PARAM_TAG

Environment information

  • diktat version: 2.0.0
  • build tool (maven/gradle): gradle
  • how is diktat run (CLI, plugin, etc.): plugin
  • kotlin version: 1.9.23
  • operating system: MacOS 14.3.1
@polarene polarene added the bug Something isn't working label Apr 8, 2024
@orchestr7
Copy link
Member

Sounds very reasonable, but looks to be fixed @DrAlexD please check

@orchestr7
Copy link
Member

@orchestr7 orchestr7 pinned this issue Jun 16, 2024
@polarene
Copy link
Author

Thanks for getting back to this bug. The PR you cited seems to be resolving a different problem, that is parameter names enclosed by backticks, not type parameters.

@DrAlexD
Copy link
Member

DrAlexD commented Jun 19, 2024

Sounds very reasonable, but looks to be fixed @DrAlexD please check

The PR you referred to was related to properties of class, as was this PR (#1892). Current issue is related to parameters of methods.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants