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

Fixed KdocComments #1754

Merged
merged 30 commits into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
37edc00
Fixed KdocComments
DrAlexD Sep 28, 2023
fc88b09
Merge branch 'master' into feature/fix-kdoc-comments
DrAlexD Sep 28, 2023
c1ebe74
- fix
DrAlexD Sep 28, 2023
d5e31fa
Merge branch 'feature/fix-kdoc-comments' of https://github.com/DrAlex…
DrAlexD Sep 28, 2023
bdef44b
- fix
DrAlexD Sep 28, 2023
382736a
- fix
DrAlexD Sep 28, 2023
d01ba9e
- fixed case when @property text in class-KDoc didn't create for KDoc…
DrAlexD Oct 2, 2023
96e3c8f
- fix
DrAlexD Oct 2, 2023
96a271c
- fix
DrAlexD Oct 2, 2023
a10486b
- fix affected classes
DrAlexD Oct 2, 2023
88f429f
- fix affected classes
DrAlexD Oct 2, 2023
8c4d75c
Merge branch 'master' into feature/fix-kdoc-comments
DrAlexD Oct 2, 2023
27fb72f
Merge branch 'master' into feature/fix-kdoc-comments
DrAlexD Oct 9, 2023
7a85200
Merge branch 'master' into feature/fix-kdoc-comments
DrAlexD Oct 9, 2023
19e59ff
- added non-fixed warning `KDOC_EXTRA_PROPERTY` for redundant `@param…
DrAlexD Oct 9, 2023
eec619c
Merge branch 'feature/fix-kdoc-comments' of https://github.com/DrAlex…
DrAlexD Oct 9, 2023
77fc1ba
- fix
DrAlexD Oct 9, 2023
2e180cb
- fix
DrAlexD Oct 9, 2023
67d18fa
- fix
DrAlexD Oct 9, 2023
43fadfc
- fix
DrAlexD Oct 10, 2023
d16ad71
- fix
DrAlexD Oct 10, 2023
78d8012
- fix
DrAlexD Oct 10, 2023
62c5bd3
- added configuration for `@param` tags creation: `isParamTagsForPara…
DrAlexD Oct 11, 2023
91016b9
- fix
DrAlexD Oct 11, 2023
b7ba451
- fix
DrAlexD Oct 11, 2023
5cfbb44
- fix docs
DrAlexD Oct 12, 2023
62bf445
- fix docs
DrAlexD Oct 12, 2023
e986c4d
- fix docs
DrAlexD Oct 16, 2023
275e45c
- fix
DrAlexD Oct 16, 2023
b03af2c
Merge branch 'master' into feature/fix-kdoc-comments
DrAlexD Oct 16, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,20 @@ import com.saveourtool.diktat.api.DiktatBaselineFactory
import com.saveourtool.diktat.api.DiktatProcessorListener
import com.saveourtool.diktat.api.DiktatReporter
import com.saveourtool.diktat.api.DiktatReporterFactory
import com.saveourtool.diktat.api.DiktatRuleConfig
import com.saveourtool.diktat.api.DiktatRuleConfigReader
import com.saveourtool.diktat.api.DiktatRuleSet
import com.saveourtool.diktat.api.DiktatRuleSetFactory
import java.io.OutputStream
import java.nio.file.Path

/**
* A factory to create [DiktatRunner]
*
* @property diktatRuleConfigReader a reader for [DiktatRuleConfig]
nulls marked this conversation as resolved.
Show resolved Hide resolved
* @property diktatRuleSetFactory a factory for [DiktatRuleSet]
* @property diktatProcessorFactory a factory for [DiktatProcessor]
* @property diktatBaselineFactory a factory for [DiktatBaseline]
* @property diktatReporterFactory a factory for [DiktatReporter]
*/
class DiktatRunnerFactory(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ import kotlinx.cli.vararg
* @property mode mode of `diktat`
* @property reporterProviderId
* @property output
* @property groupByFileInPlain
* @property colorNameInPlain
* @property logLevel
* @property patterns
*/
data class DiktatProperties(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ import kotlinx.serialization.Serializable
* This class is used to serialize/deserialize json representation
* that is used to store command line arguments
* @property shortName short argument representation like -h
* @property helpDescr
* @property longName long argument representation like --help
* @property hasArgs indicates if option should have explicit argument
* @property isRequired
*/
@Serializable
data class CliArgument(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ open class RulesConfigReader : AbstractConfigReader<List<RulesConfig>>() {
/**
* class returns the list of common configurations that we have read from a configuration map
*
* @param configuration map of common configuration
* @property configuration map of common configuration
*/
data class CommonConfiguration(private val configuration: Map<String, String>?) {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import com.google.devtools.ksp.symbol.KSClassDeclaration

/**
* [SymbolProcessor] to generate a class with contacts for names from provided enum
*
* @property codeGenerator
*/
class EnumNamesSymbolProcessor(
private val codeGenerator: CodeGenerator,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import java.io.File

/**
* An extension to configure diktat in build.gradle(.kts) file
*
* @property patternSet
*/
open class DiktatExtension(
private val patternSet: PatternSet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import java.nio.file.Path
/**
* A base task to run `diktat`
* @property extension
* @property inputs
*/
@Suppress("WRONG_NEWLINES", "Deprecation")
abstract class DiktatTaskBase(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ import java.nio.file.Path

/**
* [DiktatReporter] using __KtLint__
*
* @property ktLintReporter
* @property sourceRootDir
*/
class DiktatReporterImpl(
private val ktLintReporter: ReporterV2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import com.pinterest.ktlint.cli.reporter.core.api.ReporterV2
/**
* Wrapper for [ReporterV2]
*
* @param reporterV2
* @property reporterV2
*/
open class ReporterV2Wrapper(private val reporterV2: ReporterV2) : ReporterV2 {
override fun beforeAll() = reporterV2.beforeAll()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import org.jetbrains.kotlin.com.intellij.lang.ASTNode
* A [Warnings] entry contains rule name, warning message and is used in code check.
* @property canBeAutoCorrected whether this inspection can automatically fix the code. Should be public to be able to use it in docs generator.
* @property ruleId number of the inspection according to [diktat code style](https://github.com/saveourtool/diktat/blob/master/info/guide/diktat-coding-convention.md)
* @property warn description of the inspection
*/
@Suppress(
"ForbiddenComment",
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ class TopLevelOrderRule(configRules: List<RulesConfig>) : DiktatRule(

/**
* Class containing different groups of properties in file
*
* @property properties
*/
private data class Properties(private val properties: List<ASTNode>) : Elements {
override fun sortElements(): MutableList<ASTNode> {
Expand All @@ -94,6 +96,11 @@ class TopLevelOrderRule(configRules: List<RulesConfig>) : DiktatRule(

/**
* Class containing different children in file
*
* @property properties
* @property typealiases
* @property functions
* @property classes
*/
private data class Blocks(
private val properties: List<ASTNode>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import com.saveourtool.diktat.ruleset.rules.chapter2.kdoc.KdocComments
import com.saveourtool.diktat.util.FixTestBase

import generated.WarningNames
import org.junit.jupiter.api.Disabled
import org.junit.jupiter.api.Tag
import org.junit.jupiter.api.Tags
import org.junit.jupiter.api.Test

class KdocCommentsFixTest : FixTestBase("test/paragraph2/kdoc/", ::KdocComments) {
Expand All @@ -16,20 +16,25 @@ class KdocCommentsFixTest : FixTestBase("test/paragraph2/kdoc/", ::KdocComments)
}

@Test
@Tag(WarningNames.KDOC_NO_CONSTRUCTOR_PROPERTY)
@Tags(Tag(WarningNames.KDOC_NO_CONSTRUCTOR_PROPERTY), Tag(WarningNames.KDOC_NO_CONSTRUCTOR_PROPERTY_WITH_COMMENT), Tag(WarningNames.MISSING_KDOC_TOP_LEVEL))
fun `check fix without class kdoc`() {
fixAndCompare("ConstructorCommentNoKDocExpected.kt", "ConstructorCommentNoKDocTest.kt")
}

@Test
@Tags(Tag(WarningNames.KDOC_NO_CONSTRUCTOR_PROPERTY), Tag(WarningNames.KDOC_NO_CONSTRUCTOR_PROPERTY_WITH_COMMENT))
fun `check fix with class kdoc`() {
fixAndCompare("ConstructorCommentExpected.kt", "ConstructorCommentTest.kt")
}

@Disabled("https://github.com/saveourtool/diktat/issues/1737")
@Test
@Tag(WarningNames.KDOC_NO_CONSTRUCTOR_PROPERTY)
fun `check fix without class kdoc`() {
fixAndCompare("ConstructorCommentNoKDocExpected.kt", "ConstructorCommentNoKDocTest.kt")
@Tags(Tag(WarningNames.KDOC_NO_CONSTRUCTOR_PROPERTY), Tag(WarningNames.KDOC_NO_CONSTRUCTOR_PROPERTY_WITH_COMMENT))
fun `check fix with properties in class kdoc`() {
fixAndCompare("ConstructorCommentPropertiesExpected.kt", "ConstructorCommentPropertiesTest.kt")
}

@Test
@Tag(WarningNames.KDOC_NO_CONSTRUCTOR_PROPERTY)
@Tags(Tag(WarningNames.KDOC_NO_CONSTRUCTOR_PROPERTY), Tag(WarningNames.KDOC_NO_CONSTRUCTOR_PROPERTY_WITH_COMMENT))
fun `should preserve newlines when moving comments from value parameters`() {
fixAndCompare("ConstructorCommentNewlineExpected.kt", "ConstructorCommentNewlineTest.kt")
}
Expand Down
Loading
Loading