You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
running Spotless with Diktat and the PACKAGE_NAME_INCORRECT_PATH inspection causes the following error:
Not able to determine a path to a scanned file or "src" directory cannot be found in it's path. Will not be able to determine correct package name. It can happen due to missing <src> directory in the path
This is caused by Spotless passing file.getName() to KtLint.Params:
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: