Ignore max_line_length
property unless max-line-length
rule is enabled
#2783
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
IMPORTANT: Potential breaking change for API Consumers that provide the
max_line_length
property but not enabling/providing themax-line-length
rule of the Ktlint standard rule set.Description
Ignore
max_line_length
property unlessmax-line-length
rule is enabled. Align EditorConfig settings formax_line_length
and enable/disabling themax-line-length
ruleRules should only consider the maximum line length in case property
max_line_length
is set to a value between 0 andMAX_INTEGER - 1
, and themax-line-length
rule is provided to the KtLintRuleEngine, and themax-line-length
rule is enabled.It should not be enforced that property
max_line_length
should have valueunset
oroff
whenever themax-line-length
rule is disabled, or not provided to the KtLintRuleEngine. This property is also used by IntelliJ IDEA to display the right margin where lines should be wrapped. A user should be able to disable enforce max line length wrapping in ktlint, while still seeing the margin line in the editor.Closes #2743
Checklist
Before submitting the PR, please check following (checks which are not relevant may be ignored):
Closes #<xxx>
orFixes #<xxx>
(replace<xxx>
with issue number)Documentation is updated. See difference between snapshot and release documentation