Multi Module project not reading editorconfig file in the root directory
jonschmidt opened this issue · comments
I have a .editorconfig
file in my root directory, and when I run lintKotlin
it seems to ignore any configuration I have in there. If I copy the editorconfig
file into a submodule directory, then that submodule directory acutally uses the configuration just fine. According to everything I am reading, ktlint should traverse upwards until it hits the root directory and use the editorconfig it finds there, but this does not seem to work? I am following the multi module instructions in the documentation and using version 3.12.0
Hey @jonschmidt 👋 Thanks for reporting the issue. Would you be able to provide a repro project? AFAICS this plugin doesn't influence which .editorconfig
files are taken into account when running ktlint 🤔
I'll have a couple of thoughts/suggestion that should help you to narrow down the root cause:
- Does any of your
.editorconfig
files haveroot=true
clause? It would stop traversing upwards file hierarchy. - Would an
--info
parameter added to your gradle invocation reveal any useful details on which.edidorconfig
files are taken into account? - Having #262 in mind - does killing gradle daemon with
./gradlew stop
change/fix the behaviour you observe? - Are you able to reproduce the same behaviour when running ktlint from CLI? 👀
Hey, so this actually works now. It might have been a matter of killing the gradle daemon actually, as I reported this right when I first installed the plugin. Things seem to work ok now though. Thanks
Thanks for sharing that 🙏 I'm glad you managed to make the plugin work in your case :) I have a suspicion on what might be the root cause, but I have it on my TODO list, after I manage to merge all me PRs and Ktlint APIs stabilize a bit 😅
I'll close the issue for now, as there is nothing actionable for the given moment. Thanks again for reporting issues!