-
Notifications
You must be signed in to change notification settings - Fork 505
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
Bug on parameter's class that reached maximum line #1324
Comments
Next time, please post your code instead of an image. It is more convenient when trying to reproduce a problem. The code below is comparable to your example:
The
From this it can be seen that both the Auto-correct by the
but that same rule immediately reports now another lint error as you reported as well:
So far, I have found no way to refactor the code manually in such a way that the code is accepted by both ktlint as well as by the IntelliJ default code formatting which nowadays is a requirement when we make (bugfixes on) rules. For example, the previous code sample will be transformed by IntelliJ default formatting to following:
This is horrible code. For now, I see no other way for you to disable both rules and stick with one really long line:
Maybe, someone else has a briljant idea how to the resulting code should look like in such a way that both ktlint as well as IntelliJ default formatting do not alter that code. Next step would then be to fix the rules do that the code will be formatted as such. |
… type reference exceeds the maximum line length `parameter-list-wrapping` Closes #1324
For a function type wrapped in a nullable type it is perfectly acceptable to have a opening parenthesis starting on a new line. So the violation should indeed not have been reported. The conflicting formatting is caused by the |
* Prevent incorrect reporting of violations in case a nullable function type reference exceeds the maximum line length `parameter-list-wrapping` Closes #1324
Expected Behavior
No error.
Observed Behavior
Error.
Steps to Reproduce
I have parameter lambda code like this, let say my parameter is reached maximum limit of line :
There is error detected on
open bracket (
. I already clickedFormat with ktlint
, but still error.Your Environment
The text was updated successfully, but these errors were encountered: