-
Notifications
You must be signed in to change notification settings - Fork 39
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
Fixed KdocComments #1754
Merged
DrAlexD
merged 30 commits into
saveourtool:master
from
DrAlexD:feature/fix-kdoc-comments
Oct 16, 2023
Merged
Fixed KdocComments #1754
DrAlexD
merged 30 commits into
saveourtool:master
from
DrAlexD:feature/fix-kdoc-comments
Oct 16, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### What's done: - Added non-fixed warning `KDOC_EXTRA_PROPERTY` for case when `private` or `override` property has `@property` tag in class-KDoc. - Removed fixed warning `KDOC_NO_CONSTRUCTOR_PROPERTY` for case when `override` property hasn't `@property` tag in class-KDoc. - Added non-fixed warning `KDOC_NO_CONSTRUCTOR_PROPERTY_WITH_COMMENT` for case when `private` or `override` property has comment before. - Changed warning `KDOC_NO_CONSTRUCTOR_PROPERTY` to `KDOC_NO_CONSTRUCTOR_PROPERTY_WITH_COMMENT` for case when non-`private` and non-`override` property has comment before. - Added check is warning `KDOC_NO_CONSTRUCTOR_PROPERTY_WITH_COMMENT` fixable for case when non-`private` and non-`override` property has tags in KDoc-comment before. If it has = non-fixed. - Fixed case when text from comment before non-`private` and non-`override` property didn't append to the end of `@property` text in class-KDoc for that property. - Fixed case when `@property` text in class-KDoc didn't create for KDoc-comment before non-`private` and non-`override` property. - Fixed functions `removeWithWhiteSpace` and `removeChildMergingSurroundingWhitespaces` for additional handling KDoc-comments. - Reworked fix tests. Added fix test for case when `@property` tag exist in class-KDoc. - Added warning tests. It's part of saveourtool#1737
…D/diktat into feature/fix-kdoc-comments # Conflicts: # diktat-rules/src/main/kotlin/com/saveourtool/diktat/ruleset/rules/chapter2/kdoc/KdocComments.kt
diktat-rules/src/main/kotlin/com/saveourtool/diktat/ruleset/rules/chapter2/kdoc/KdocComments.kt
Fixed
Show fixed
Hide fixed
Codecov Report
@@ Coverage Diff @@
## master #1754 +/- ##
============================================
+ Coverage 76.75% 77.09% +0.33%
- Complexity 2301 2376 +75
============================================
Files 126 126
Lines 8295 8408 +113
Branches 2081 2131 +50
============================================
+ Hits 6367 6482 +115
+ Misses 997 976 -21
- Partials 931 950 +19
|
…-comment before private and override property - fixed case when there wasn't empty line after class-Kdoc description and before any tag - fixed case when indentation wasn't created before content of new line if tag block cannot be described in one line
nulls
reviewed
Oct 2, 2023
diktat-api/src/main/kotlin/com/saveourtool/diktat/DiktatRunnerFactory.kt
Outdated
Show resolved
Hide resolved
nulls
requested changes
Oct 3, 2023
diktat-api/src/main/kotlin/com/saveourtool/diktat/DiktatRunnerFactory.kt
Outdated
Show resolved
Hide resolved
…` tags in class-KDoc - added fixed warnings `KDOC_NO_CONSTRUCTOR_PROPERTY` and `KDOC_NO_CONSTRUCTOR_PROPERTY_WITH_COMMENT` due to `private` properties and parameters must have `@param` tags in class-KDoc
…D/diktat into feature/fix-kdoc-comments
diktat-rules/src/main/kotlin/com/saveourtool/diktat/ruleset/rules/chapter2/kdoc/KdocComments.kt
Fixed
Show fixed
Hide fixed
diktat-rules/src/main/kotlin/com/saveourtool/diktat/ruleset/rules/chapter2/kdoc/KdocComments.kt
Fixed
Show fixed
Hide fixed
diktat-rules/src/main/kotlin/com/saveourtool/diktat/ruleset/rules/chapter2/kdoc/KdocComments.kt
Fixed
Show fixed
Hide fixed
…meters` and `isParamTagsForPrivateProperties` - fix affected classes
diktat-rules/src/main/kotlin/com/saveourtool/diktat/ruleset/rules/chapter2/kdoc/KdocComments.kt
Fixed
Show fixed
Hide fixed
diktat-rules/src/main/kotlin/com/saveourtool/diktat/ruleset/rules/chapter2/kdoc/KdocComments.kt
Fixed
Show fixed
Hide fixed
nulls
approved these changes
Oct 16, 2023
diktat-cli/src/main/kotlin/com/saveourtool/diktat/cli/DiktatProperties.kt
Show resolved
Hide resolved
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What's done:
KDOC_NO_CONSTRUCTOR_PROPERTY
toKDOC_NO_CONSTRUCTOR_PROPERTY_WITH_COMMENT
in some cases when property or parameter has comment before.KDOC_NO_CONSTRUCTOR_PROPERTY_WITH_COMMENT
fixable for case when property or parameter has any tags in KDoc-comment before. If it has = non-fixed.@param
tags creation:isParamTagsForParameters
andisParamTagsForPrivateProperties
.KDOC_NO_CONSTRUCTOR_PROPERTY
andKDOC_NO_CONSTRUCTOR_PROPERTY_WITH_COMMENT
for cases when configuration options are on, and thenprivate
properties and parameters 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.KDOC_EXTRA_PROPERTY
for redundant@param
tags in class-KDoc.@property
or@param
tag exist in class-KDoc.It's part of #1737