-
Notifications
You must be signed in to change notification settings - Fork 458
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
spotless ktlint reports exceeded max line length incorrectly #1913
Comments
Can you try your code with Ktlint CLI? |
Is this behavior the same with Spotless? |
No. As I said, ktlint cli works fine. ktlint in spotless finds strange violations with line length. It's seems strange as .editorconfig is the same, version of ktlint is also the same. |
Can you create a minimum reproducer for me? |
I will try to reproduce this issue on small project, and add link to it if I succeed. |
Here it is. https://github.com/astoriawinter/TestRepoSpotless |
Facing a similar issue in my project with ktlint 1.2.1. Btw, it works correctly with ktlint 0.50.0. |
just want to confirm that it is related with the gradle daemon, changeing a value in the editorconfig and then running
|
Any updates on this? I am getting this problem for one file and no amount of changing .editorconfig and stopping gradle fixes it. |
Hi, guys!
Summary of problem
Somehow running spotlessApply causes Exceeded max line length (120) codestyle errors all over the project.
But, I see in Android Studio that line dosn't really exceeds this limit, also running ktlint itself doesn't find such errors.
And sometimes report of line that "exceeds line length" is not correct.
Also, I can say that .editorcofig is read correctly, as some ignored rules are not applied as stated. I also tried to increased the limit of line length to 130 just for test, but it's not working.
Gradle or Maven version
Gradle 8.3
Spotless version
6.22.0
Operating system and version
MacOs Sonoma 14.1.1
copy-paste your full Spotless configuration block(s)
copy-paste the full content of any console errors emitted by
gradlew spotless[Apply/Check] --stacktrace
case 1, incorrect report of 120 lines, right "error" position
Full log + image from ide
Screen of code, line means 120 symbols:case 2, same error, incorrect line reported
Full log + image from ide
On 146 line there can't be any exceeds, but on line 136 there is 119 sybmols. If I shorten 136th line, the error disappears. Screen of code:
Log:
The text was updated successfully, but these errors were encountered: