-
Notifications
You must be signed in to change notification settings - Fork 507
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
function-literal
rule conflict with maximum line length
#2743
Comments
The |
In hindsight the "solution" above is really crude. What I meant to say was that if you really want to disable the max-line-length checking, that you need to set below:
Disabling the The "mistake" you made is very understandable and you can not be blamed for it. Even in case it would have been documented properly (which it isn't), this misleads others as well. Ktlint should be more fault tolerant. |
…g the `max-line-length` rule IMPORTANT: Potential breaking change for API Consumers that provide the `max_line_length` property but not enabling/providing the `max-line-length` rule of the Ktlint standard rule set. Rules should only consider the maximum line length in case property `max_line_length` is set to a value between 0 and `MAX_INTEGER - 1`, and the `max-line-length` rule is provided to the KtLintRuleEngine, and the `max-line-length` rule is enabled. It should not be enforced that property `max_line_length` should have value `unset` or `off` whenever the `max-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
…abled (#2783) * Align EditorConfig settings for `max_line_length` and enable/disabling the `max-line-length` rule IMPORTANT: Potential breaking change for API Consumers that provide the `max_line_length` property but not enabling/providing the `max-line-length` rule of the Ktlint standard rule set. Rules should only consider the maximum line length in case property `max_line_length` is set to a value between 0 and `MAX_INTEGER - 1`, and the `max-line-length` rule is provided to the KtLintRuleEngine, and the `max-line-length` rule is enabled. It should not be enforced that property `max_line_length` should have value `unset` or `off` whenever the `max-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 * Update documentation
Every time the code is formatted with ktlint, the code block below alternates between the two states given at the
Observed Behavior
.Expected Behavior
I expect this to be accepted without raising an error.
Observed Behavior
Below code gives us the error:
Newline expected before parameter (standard:function-literal)
However, below code gives us the error:
No newline expected before parameter (standard:function-literal)
Steps to Reproduce
Example code provided above.
Your Environment
.editorconfig
settingsThe text was updated successfully, but these errors were encountered: