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
Import order regression in 0.47 #1603
Comments
I can not reproduce the problem with information above. What is the exact command you are running? Please also check of there are any other |
I have a multi-module maven project and I am running ktlint with maven plugin, goal - check. As you can see in sources, it just passes everything to ktlint itself without any pre-processing. Here's a a reproducible: ktlint-bug.zip Windows output:
Ubuntu 22 output:
|
There are some known problems with this release for Windows users. In your original request you wrote that the problem also occurred on Linux. Would you mind double checking that? |
There are outputs above are from Windows 10 and Ubuntu 22. |
Tnx for the sample project. That project reproduces the problem for me. I expect the problem to be caused by the way that the file name is passed to ktlint. https://github.com/gantsign/ktlint-maven-plugin/blob/main/src/main/kotlin/com/github/gantsign/maven/plugin/ktlint/internal/AbstractCheckSupport.kt#L191 makes the filename relative before sending it to ktlint. I expect that due to changes in ktlint 0.47 the If you would comment out line below in
It would be cool, if you could test what happens in case you pass down the absolute path to the file instead of a relative file. |
hm, I'm not sure what you mean, because I'm not passing anything :) |
No, I meant it would be nice if you could change the ktlint-maven-plugin to pass the absolute path and test locally what would happen. But that was assuming that you were a contributor to that project, but I guess you are not. |
Hi all, you can find the fix in the latest version of the ktlint-maven-plugin plugin:
|
Fixed in ktlint-maven-plugin. |
Sample code:
ktlint output:
Reproducible both on Windows and Linux.
.editorconfig:
Nothing changed in the project except ktlint version.
The text was updated successfully, but these errors were encountered: