-
Notifications
You must be signed in to change notification settings - Fork 455
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 causes Diktat to fail to execute PACKAGE_NAME_INCORRECT_PATH inspection correctly #1189
Comments
PR's welcome :) If you happen to be interested in adding more diktat features, #524 would be a good approach. |
I can confirm @HaukeRa 's idea - in diktat-maven-plugin there is a similar setup with invoking |
Fixed by @petertrr , released in |
As already reported by someone to Diktat's issue tracker:
saveourtool/diktat#1202
running Spotless with Diktat and the PACKAGE_NAME_INCORRECT_PATH inspection causes the following error:
This is caused by Spotless passing file.getName() to KtLint.Params:
spotless/lib/src/main/java/com/diffplug/spotless/kotlin/DiktatStep.java
Line 155 in a8f208a
The parameter name is
fileName
but the documentation of the class states that it expects the "path of file to lint/format".Spotless also tries to pass the absolute file name in the
Params::userData
map, but this value will get overriden with the value passed tofileName
here:https://github.com/pinterest/ktlint/blob/3472532b6e413ac302c3f63fc75a32db0169f54c/ktlint-core/src/main/kotlin/com/pinterest/ktlint/core/KtLint.kt#L279
Spotless-Gradle 6.5.1
Spotless 2.25.1
Diktat 1.1.0
KtLint 0.45.2
Gradle 7.4.2
Windows 10 21H2 / Ubuntu 20.04.4 LTS
Config:
The text was updated successfully, but these errors were encountered: