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

False KDOC_EXTRA_PROPERTY for type in generic classes #1825

Closed
nulls opened this issue Nov 27, 2023 · 0 comments · Fixed by #1832
Closed

False KDOC_EXTRA_PROPERTY for type in generic classes #1825

nulls opened this issue Nov 27, 2023 · 0 comments · Fixed by #1832
Assignees
Labels
bug Something isn't working
Milestone

Comments

@nulls
Copy link
Member

nulls commented Nov 27, 2023

Steps to reproduce:

/**
 * S3 implementation of Storage
 *
 * @param s3Operations [S3Operations] to operate with S3
 * @param K type of key
 */
abstract class AbstractReactiveStorage<K : Any>(
    s3Operations: S3Operations,
) : ReactiveStorage<K> {
  // TODO
}

Diktat 2.0 generates D:/projects/save-cloud/save-cloud-common/src/jvmMain/kotlin/com/saveourtool/save/storage/AbstractReactiveStorage.kt:17:4: [KDOC_EXTRA_PROPERTY] There is property in KDoc which is not present in the class: @param K type of key (cannot be auto-corrected) (diktat-ruleset:kdoc-comments)

@nulls nulls added the bug Something isn't working label Nov 27, 2023
@nulls nulls added this to the 2.1.0 milestone Nov 27, 2023
DrAlexD added a commit to DrAlexD/diktat that referenced this issue Nov 29, 2023
### What's done:
- fixed case when `KDOC_EXTRA_PROPERTY` warning generation didn't take into account types in generic classes.
- added configuration `isParamTagsForGenericTypes` for `@param` tags creation for types in generic classes.
- added fixed warnings `KDOC_NO_CONSTRUCTOR_PROPERTY` for cases when configuration option are on, and then generic types must have `@param` tags in class-KDoc. Additionally added logic for replacing incorrect tag with correct one regardless of whether configuration is enabled or not.
- added new warning and fix tests.

Closes saveourtool#1825
DrAlexD added a commit that referenced this issue Nov 29, 2023
### What's done:
- fixed case when `KDOC_EXTRA_PROPERTY` warning generation didn't take into account types in generic classes.
- added configuration `isParamTagsForGenericTypes` for `@param` tags creation for types in generic classes.
- added fixed warnings `KDOC_NO_CONSTRUCTOR_PROPERTY` for cases when configuration option are on, and then generic types must have `@param` tags in class-KDoc. Additionally added logic for replacing incorrect tag with correct one regardless of whether configuration is enabled or not.
- added new warning and fix tests.

Closes #1825
@nulls nulls modified the milestones: 2.1.0, 2.0.0 Nov 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants