From 319d8ab7ae49ee9168796d248f5549c1a2bc7eba Mon Sep 17 00:00:00 2001 From: Andrey Shcheglov Date: Thu, 2 Jun 2022 14:44:37 +0300 Subject: [PATCH] Set the default values of `extendedIndentAfterOperators` and `extendedIndentBeforeDot` to `false` ### What's done: * Since Kotlin style guide mentions no continuation indent, and IDEA defaults to no continuation indent as well, all `extendedIndent*` flags default to `false` from now on. * Closes: #1312 --- diktat-analysis.yml | 4 ++-- diktat-common/src/test/resources/test-rules-config.yml | 2 +- .../diktat/ruleset/utils/indentation/IndentationConfig.kt | 4 ++-- diktat-rules/src/main/resources/diktat-analysis-huawei.yml | 4 ++-- diktat-rules/src/main/resources/diktat-analysis.yml | 4 ++-- examples/gradle-groovy-dsl/diktat-analysis.yml | 4 ++-- examples/gradle-kotlin-dsl-multiproject/diktat-analysis.yml | 2 +- examples/gradle-kotlin-dsl/diktat-analysis.yml | 4 ++-- examples/maven/diktat-analysis.yml | 4 ++-- 9 files changed, 16 insertions(+), 16 deletions(-) diff --git a/diktat-analysis.yml b/diktat-analysis.yml index c45483b190..0fcd096b5a 100644 --- a/diktat-analysis.yml +++ b/diktat-analysis.yml @@ -206,7 +206,7 @@ # If true: if first parameter in parameter list is on the same line as opening parenthesis, then other parameters can be aligned with it alignedParameters: true # If true: if expression is split by newline after operator like +/-/`*`, then the next line is indented with two indentations instead of one - extendedIndentAfterOperators: true + extendedIndentAfterOperators: false # If true: when dot qualified expression starts on a new line, this line will be indented with two indentations instead of one extendedIndentBeforeDot: false # The indentation size for each file @@ -527,4 +527,4 @@ enabled: true # Only properties from the primary constructor should be documented in a @property tag in class KDoc - name: KDOC_NO_CLASS_BODY_PROPERTIES_IN_HEADER - enabled: true \ No newline at end of file + enabled: true diff --git a/diktat-common/src/test/resources/test-rules-config.yml b/diktat-common/src/test/resources/test-rules-config.yml index c624736371..f1436ebc9d 100644 --- a/diktat-common/src/test/resources/test-rules-config.yml +++ b/diktat-common/src/test/resources/test-rules-config.yml @@ -127,7 +127,7 @@ newlineAtEnd: true extendedIndentOfParameters: false alignedParameters: true - extendedIndentAfterOperators: true + extendedIndentAfterOperators: false indentationSize: 4 - name: EMPTY_BLOCK_STRUCTURE_ERROR enabled: true diff --git a/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/utils/indentation/IndentationConfig.kt b/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/utils/indentation/IndentationConfig.kt index 35aa9e6c8d..184ac437b5 100644 --- a/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/utils/indentation/IndentationConfig.kt +++ b/diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/utils/indentation/IndentationConfig.kt @@ -26,13 +26,13 @@ internal class IndentationConfig(config: Map) : RuleConfiguratio /** * If true, if expression is split by newline after operator like +/-/`*`, then the next line is indented with two indentations instead of one */ - val extendedIndentAfterOperators = config["extendedIndentAfterOperators"]?.toBoolean() ?: true + val extendedIndentAfterOperators = config["extendedIndentAfterOperators"]?.toBoolean() ?: false /** * If true, when dot qualified expression starts on a new line, this line will be indented with * two indentations instead of one */ - val extendedIndentBeforeDot = config["extendedIndentBeforeDot"]?.toBoolean() ?: true + val extendedIndentBeforeDot = config["extendedIndentBeforeDot"]?.toBoolean() ?: false /** * The indentation size for each file diff --git a/diktat-rules/src/main/resources/diktat-analysis-huawei.yml b/diktat-rules/src/main/resources/diktat-analysis-huawei.yml index cd0f924ae8..ea28cbf797 100644 --- a/diktat-rules/src/main/resources/diktat-analysis-huawei.yml +++ b/diktat-rules/src/main/resources/diktat-analysis-huawei.yml @@ -208,7 +208,7 @@ # If true: if first parameter in parameter list is on the same line as opening parenthesis, then other parameters can be aligned with it alignedParameters: true # If true: if expression is split by newline after operator like +/-/`*`, then the next line is indented with two indentations instead of one - extendedIndentAfterOperators: true + extendedIndentAfterOperators: false # If true: when dot qualified expression starts on a new line, this line will be indented with two indentations instead of one extendedIndentBeforeDot: false # The indentation size for each file @@ -529,4 +529,4 @@ enabled: true # Only properties from the primary constructor should be documented in a @property tag in class KDoc - name: KDOC_NO_CLASS_BODY_PROPERTIES_IN_HEADER - enabled: true \ No newline at end of file + enabled: true diff --git a/diktat-rules/src/main/resources/diktat-analysis.yml b/diktat-rules/src/main/resources/diktat-analysis.yml index 3e74fe4488..44b79990ad 100644 --- a/diktat-rules/src/main/resources/diktat-analysis.yml +++ b/diktat-rules/src/main/resources/diktat-analysis.yml @@ -208,7 +208,7 @@ # If true: if first parameter in parameter list is on the same line as opening parenthesis, then other parameters can be aligned with it alignedParameters: true # If true: if expression is split by newline after operator like +/-/`*`, then the next line is indented with two indentations instead of one - extendedIndentAfterOperators: true + extendedIndentAfterOperators: false # The indentation size for each file indentationSize: 4 # Checks that there is no empty blocks in a file. @@ -525,4 +525,4 @@ enabled: true # Only properties from the primary constructor should be documented in a @property tag in class KDoc - name: KDOC_NO_CLASS_BODY_PROPERTIES_IN_HEADER - enabled: true \ No newline at end of file + enabled: true diff --git a/examples/gradle-groovy-dsl/diktat-analysis.yml b/examples/gradle-groovy-dsl/diktat-analysis.yml index 0821db12f6..90cf8ff7c7 100644 --- a/examples/gradle-groovy-dsl/diktat-analysis.yml +++ b/examples/gradle-groovy-dsl/diktat-analysis.yml @@ -208,7 +208,7 @@ # If true: if first parameter in parameter list is on the same line as opening parenthesis, then other parameters can be aligned with it alignedParameters: true # If true: if expression is split by newline after operator like +/-/`*`, then the next line is indented with two indentations instead of one - extendedIndentAfterOperators: true + extendedIndentAfterOperators: false # The indentation size for each file indentationSize: 4 # Checks that there is no empty blocks in a file. @@ -525,4 +525,4 @@ enabled: true # Only properties from the primary constructor should be documented in a @property tag in class KDoc - name: KDOC_NO_CLASS_BODY_PROPERTIES_IN_HEADER - enabled: true \ No newline at end of file + enabled: true diff --git a/examples/gradle-kotlin-dsl-multiproject/diktat-analysis.yml b/examples/gradle-kotlin-dsl-multiproject/diktat-analysis.yml index a2f0b92333..0c6d87f3a2 100644 --- a/examples/gradle-kotlin-dsl-multiproject/diktat-analysis.yml +++ b/examples/gradle-kotlin-dsl-multiproject/diktat-analysis.yml @@ -130,7 +130,7 @@ newlineAtEnd: true extendedIndentOfParameters: false alignedParameters: true - extendedIndentAfterOperators: true + extendedIndentAfterOperators: false indentationSize: 4 - name: EMPTY_BLOCK_STRUCTURE_ERROR enabled: true diff --git a/examples/gradle-kotlin-dsl/diktat-analysis.yml b/examples/gradle-kotlin-dsl/diktat-analysis.yml index 0821db12f6..90cf8ff7c7 100644 --- a/examples/gradle-kotlin-dsl/diktat-analysis.yml +++ b/examples/gradle-kotlin-dsl/diktat-analysis.yml @@ -208,7 +208,7 @@ # If true: if first parameter in parameter list is on the same line as opening parenthesis, then other parameters can be aligned with it alignedParameters: true # If true: if expression is split by newline after operator like +/-/`*`, then the next line is indented with two indentations instead of one - extendedIndentAfterOperators: true + extendedIndentAfterOperators: false # The indentation size for each file indentationSize: 4 # Checks that there is no empty blocks in a file. @@ -525,4 +525,4 @@ enabled: true # Only properties from the primary constructor should be documented in a @property tag in class KDoc - name: KDOC_NO_CLASS_BODY_PROPERTIES_IN_HEADER - enabled: true \ No newline at end of file + enabled: true diff --git a/examples/maven/diktat-analysis.yml b/examples/maven/diktat-analysis.yml index 0821db12f6..90cf8ff7c7 100644 --- a/examples/maven/diktat-analysis.yml +++ b/examples/maven/diktat-analysis.yml @@ -208,7 +208,7 @@ # If true: if first parameter in parameter list is on the same line as opening parenthesis, then other parameters can be aligned with it alignedParameters: true # If true: if expression is split by newline after operator like +/-/`*`, then the next line is indented with two indentations instead of one - extendedIndentAfterOperators: true + extendedIndentAfterOperators: false # The indentation size for each file indentationSize: 4 # Checks that there is no empty blocks in a file. @@ -525,4 +525,4 @@ enabled: true # Only properties from the primary constructor should be documented in a @property tag in class KDoc - name: KDOC_NO_CLASS_BODY_PROPERTIES_IN_HEADER - enabled: true \ No newline at end of file + enabled: true