Generated .editorconfig
contains invalid max_line_length
value
#1824
Labels
Milestone
.editorconfig
contains invalid max_line_length
value
#1824
Expected Behavior
The default value of the standard
max_line_length
property is a positive integer oroff
according to the documentation.Observed Behavior
When running
ktlint generateEditorConfig
without any options set, the produced (default) file containsmax_line_length = -1
. This causes IntelliJ to freak out and try to shrink every line as much as possible (since every line always has more than "-1" characters).Steps to Reproduce
Run
ktlint generateEditorConfig
in a new IntelliJ project and use the output.Your Environment
.editorconfig
settings:max_line_length
The current
editorconfig
-related code already parsesoff
values correctly as seen here:ktlint/ktlint-rule-engine-core/src/main/kotlin/com/pinterest/ktlint/rule/engine/core/api/editorconfig/MaxLineLengthEditorConfigProperty.kt
Line 33 in 2d1ab84
but on output it writes the invalid value
-1
.Additionally, the documentation mentions the
off
value here, and incorrectly states that-1
is a valid alternative.Finally, I found a reference to the invalid
-1
value in this issue comment: #659 (comment)The text was updated successfully, but these errors were encountered: