Skip to content

Commit

Permalink
Set the default values of extendedIndentAfterOperators and `extende…
Browse files Browse the repository at this point in the history
…dIndentBeforeDot` 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
  • Loading branch information
0x6675636b796f75676974687562 committed Jun 3, 2022
1 parent 92f2fef commit e6a670c
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions diktat-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
enabled: true
2 changes: 1 addition & 1 deletion diktat-common/src/test/resources/test-rules-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
newlineAtEnd: true
extendedIndentOfParameters: false
alignedParameters: true
extendedIndentAfterOperators: true
extendedIndentAfterOperators: false
indentationSize: 4
- name: EMPTY_BLOCK_STRUCTURE_ERROR
enabled: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ internal class IndentationConfig(config: Map<String, String>) : 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
Expand Down
4 changes: 2 additions & 2 deletions diktat-rules/src/main/resources/diktat-analysis-huawei.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
enabled: true
4 changes: 2 additions & 2 deletions diktat-rules/src/main/resources/diktat-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
enabled: true
4 changes: 2 additions & 2 deletions examples/gradle-groovy-dsl/diktat-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
enabled: true
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
newlineAtEnd: true
extendedIndentOfParameters: false
alignedParameters: true
extendedIndentAfterOperators: true
extendedIndentAfterOperators: false
indentationSize: 4
- name: EMPTY_BLOCK_STRUCTURE_ERROR
enabled: true
Expand Down
4 changes: 2 additions & 2 deletions examples/gradle-kotlin-dsl/diktat-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
enabled: true
4 changes: 2 additions & 2 deletions examples/maven/diktat-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
enabled: true

0 comments on commit e6a670c

Please sign in to comment.