diff --git a/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/DiktatRuleSetProvider.kt b/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/DiktatRuleSetProvider.kt index 1ae2ad05ed..214975c24d 100644 --- a/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/DiktatRuleSetProvider.kt +++ b/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/DiktatRuleSetProvider.kt @@ -184,7 +184,6 @@ class DiktatRuleSetProvider(private var diktatConfigFile: String = DIKTAT_ANALYS ::SingleInitRule, ::RangeConventionalRule, ::CustomLabel, - ::ParameterNameInOuterLambdaRule, ::VariableGenericTypeDeclarationRule, ::LongNumericalValuesSeparatedRule, ::NestedFunctionBlock, @@ -213,6 +212,7 @@ class DiktatRuleSetProvider(private var diktatConfigFile: String = DIKTAT_ANALYS ::ExtensionFunctionsSameNameRule, ::LambdaLengthRule, ::BooleanExpressionsRule, + ::ParameterNameInOuterLambdaRule, // formatting: moving blocks, adding line breaks, indentations etc. ::BlockStructureBraces, ::ConsecutiveSpacesRule, diff --git a/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter2/comments/HeaderCommentRule.kt b/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter2/comments/HeaderCommentRule.kt index a3b0b6ceef..6b11e0c0a2 100644 --- a/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter2/comments/HeaderCommentRule.kt +++ b/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter2/comments/HeaderCommentRule.kt @@ -272,7 +272,7 @@ class HeaderCommentRule(configRules: List) : DiktatRule( companion object { private val log = LoggerFactory.getLogger(HeaderCommentRule::class.java) const val CURR_YEAR_PATTERN = ";@currYear;" - const val NAME_ID = "acp-header-comment" + const val NAME_ID = "zcp-header-comment" val hyphenRegex = Regex("""\d+-\d+""") val afterCopyrightRegex = Regex("""((©|\([cC]\))+ *\d+)""") val curYear = LocalDate.now().year diff --git a/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter3/BlockStructureBraces.kt b/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter3/BlockStructureBraces.kt index 47f4cb0e59..b7458d3a71 100644 --- a/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter3/BlockStructureBraces.kt +++ b/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter3/BlockStructureBraces.kt @@ -273,6 +273,6 @@ class BlockStructureBraces(configRules: List) : DiktatRule( } companion object { - const val NAME_ID = "acn-block-structure" + const val NAME_ID = "zcn-block-structure" } } diff --git a/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter3/ConsecutiveSpacesRule.kt b/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter3/ConsecutiveSpacesRule.kt index c2f0697b68..00516ebc26 100644 --- a/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter3/ConsecutiveSpacesRule.kt +++ b/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter3/ConsecutiveSpacesRule.kt @@ -84,6 +84,6 @@ class ConsecutiveSpacesRule(configRules: List) : DiktatRule( companion object { private const val MAX_SPACES = 1 - const val NAME_ID = "aco-too-many-spaces" + const val NAME_ID = "zco-too-many-spaces" } } diff --git a/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter3/files/FileStructureRule.kt b/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter3/files/FileStructureRule.kt index 5f77d00f26..46f9be75e8 100644 --- a/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter3/files/FileStructureRule.kt +++ b/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter3/files/FileStructureRule.kt @@ -395,6 +395,6 @@ class FileStructureRule(configRules: List) : DiktatRule( } companion object { - const val NAME_ID = "acq-file-structure" + const val NAME_ID = "zcq-file-structure" } } diff --git a/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter3/files/IndentationRule.kt b/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter3/files/IndentationRule.kt index 77f74537eb..d767067115 100644 --- a/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter3/files/IndentationRule.kt +++ b/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter3/files/IndentationRule.kt @@ -387,7 +387,7 @@ class IndentationRule(configRules: List) : DiktatRule( companion object { private val log = LoggerFactory.getLogger(IndentationRule::class.java) const val INDENT_SIZE = 4 - const val NAME_ID = "act-indentation" + const val NAME_ID = "zct-indentation" private val increasingTokens = listOf(LPAR, LBRACE, LBRACKET, LONG_TEMPLATE_ENTRY_START) private val decreasingTokens = listOf(RPAR, RBRACE, RBRACKET, LONG_TEMPLATE_ENTRY_END) private val matchingTokens = increasingTokens.zip(decreasingTokens) diff --git a/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter3/files/NewlinesRule.kt b/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter3/files/NewlinesRule.kt index a3802d4686..9f4dc6c7c1 100644 --- a/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter3/files/NewlinesRule.kt +++ b/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter3/files/NewlinesRule.kt @@ -641,7 +641,7 @@ class NewlinesRule(configRules: List) : DiktatRule( companion object { private val log = LoggerFactory.getLogger(NewlinesRule::class.java) const val MAX_CALLS_IN_ONE_LINE = 3 - const val NAME_ID = "acr-newlines" + const val NAME_ID = "zcr-newlines" // fixme: these token sets can be not full, need to add new once as corresponding cases are discovered. // error is raised if these operators are prepended by newline diff --git a/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter3/files/WhiteSpaceRule.kt b/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter3/files/WhiteSpaceRule.kt index 52a45356b3..8fe6c60886 100644 --- a/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter3/files/WhiteSpaceRule.kt +++ b/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter3/files/WhiteSpaceRule.kt @@ -424,7 +424,7 @@ class WhiteSpaceRule(configRules: List) : DiktatRule( companion object { private val log = LoggerFactory.getLogger(CompactInitialization::class.java) - const val NAME_ID = "acs-horizontal-whitespace" + const val NAME_ID = "zcs-horizontal-whitespace" private const val NUM_PARENTS_FOR_LAMBDA = 3 // this is the number of parent nodes needed to check if this node is lambda from argument list private val keywordsWithSpaceAfter = TokenSet.create( diff --git a/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter4/ImmutableValNoVarRule.kt b/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter4/ImmutableValNoVarRule.kt index 189513986b..ed31b502c2 100644 --- a/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter4/ImmutableValNoVarRule.kt +++ b/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter4/ImmutableValNoVarRule.kt @@ -55,6 +55,6 @@ class ImmutableValNoVarRule(configRules: List) : DiktatRule( } } companion object { - const val NAME_ID = "abt-accurate-calculations" + const val NAME_ID = "aci-no-var-rule" } } diff --git a/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter5/ParameterNameInOuterLambdaRule.kt b/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter5/ParameterNameInOuterLambdaRule.kt index 416b47de2c..a66abba704 100644 --- a/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter5/ParameterNameInOuterLambdaRule.kt +++ b/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter5/ParameterNameInOuterLambdaRule.kt @@ -13,7 +13,7 @@ import org.jetbrains.kotlin.com.intellij.lang.ASTNode * Rule 5.2.7 check parameter name in outer lambda */ class ParameterNameInOuterLambdaRule(configRules: List) : DiktatRule( - "parameter-name-in-outer-lambda", + NAME_ID, configRules, listOf(PARAMETER_NAME_IN_OUTER_LAMBDA) ) { @@ -35,4 +35,7 @@ class ParameterNameInOuterLambdaRule(configRules: List) : DiktatRul ) } } + companion object { + const val NAME_ID = "acn-parameter-name-in-outer-lambda" + } } diff --git a/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter6/classes/StatelessClassesRule.kt b/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter6/classes/StatelessClassesRule.kt index 54e842f591..b26da4a58a 100644 --- a/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter6/classes/StatelessClassesRule.kt +++ b/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/rules/chapter6/classes/StatelessClassesRule.kt @@ -92,6 +92,6 @@ class StatelessClassesRule(configRules: List) : DiktatRule( } companion object { - const val NAME_ID = "abi-multiple-init-block" + const val NAME_ID = "aaz-stateless-class" } } diff --git a/diktat-rules/src/test/kotlin/org/cqfn/diktat/ruleset/chapter5/ParameterNameInOuterLambdaRuleWarnTest.kt b/diktat-rules/src/test/kotlin/org/cqfn/diktat/ruleset/chapter5/ParameterNameInOuterLambdaRuleWarnTest.kt index cae45ff0d7..7c05cbf9a8 100644 --- a/diktat-rules/src/test/kotlin/org/cqfn/diktat/ruleset/chapter5/ParameterNameInOuterLambdaRuleWarnTest.kt +++ b/diktat-rules/src/test/kotlin/org/cqfn/diktat/ruleset/chapter5/ParameterNameInOuterLambdaRuleWarnTest.kt @@ -4,6 +4,7 @@ import org.cqfn.diktat.common.config.rules.RulesConfig import org.cqfn.diktat.ruleset.constants.Warnings import org.cqfn.diktat.ruleset.rules.DIKTAT_RULE_SET_ID import org.cqfn.diktat.ruleset.rules.chapter5.ParameterNameInOuterLambdaRule +import org.cqfn.diktat.ruleset.rules.chapter6.classes.AbstractClassesRule import org.cqfn.diktat.util.LintTestBase import com.pinterest.ktlint.core.LintError @@ -12,7 +13,7 @@ import org.junit.jupiter.api.Tag import org.junit.jupiter.api.Test class ParameterNameInOuterLambdaRuleWarnTest : LintTestBase(::ParameterNameInOuterLambdaRule) { - private val ruleId = "$DIKTAT_RULE_SET_ID:parameter-name-in-outer-lambda" + private val ruleId = "$DIKTAT_RULE_SET_ID:${ParameterNameInOuterLambdaRule.NAME_ID}" private val rulesConfigList: List = listOf( RulesConfig(Warnings.PARAMETER_NAME_IN_OUTER_LAMBDA.name, true) )