-
Notifications
You must be signed in to change notification settings - Fork 509
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Internal Error (rule 'standard:binary-expression-wrapping') #2601
Comments
Please include code sample that reproduces the problem. Also specify editorconfig and klont version |
ktlint version 1.2.1 File kt example:
Rules:
|
Tnx for reporting. I can reproduce the problem. It is caused by the newline character in the last block comment. You can prevent this problem by writing the code like:
But of course not exception should have thrown. |
paul-dingemans
added a commit
that referenced
this issue
Mar 12, 2024
…preceded on the same line by a block comment containing a newline character Function `leavesOnLine` calls function `getFirstLeafOnLineOrSelf` which finds the first leaf on the line by looking for newline character. A block comment containing a newline character resulted in considering that block comment to be the first element on the line, even in case it was preceded by other elements on the same line. Due to this change, the `max-line-length` rule failed, which has been resolved by refactoring the calculation of the line length. Closes #2601
8 tasks
paul-dingemans
added a commit
that referenced
this issue
Mar 17, 2024
…preceded on the same line by a block comment containing a newline character (#2607) Function `leavesOnLine` calls function `getFirstLeafOnLineOrSelf` which finds the first leaf on the line by looking for newline character. A block comment containing a newline character resulted in considering that block comment to be the first element on the line, even in case it was preceded by other elements on the same line. Due to this change, the `max-line-length` rule failed, which has been resolved by refactoring the calculation of the line length. Closes #2601
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Error:
Version 1.2.1
./ktlint -F /path/**/*.kt
The text was updated successfully, but these errors were encountered: