Skip to content
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

Multi Module project not reading editorconfig file in the root directory #303

Closed
jonschmidt opened this issue Dec 7, 2022 · 3 comments
Closed

Comments

@jonschmidt
Copy link

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

@mateuszkwiecinski
Copy link
Collaborator

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:

  1. Does any of your .editorconfig files have root=true clause? It would stop traversing upwards file hierarchy.
  2. Would an --info parameter added to your gradle invocation reveal any useful details on which .edidorconfig files are taken into account?
  3. Having Regression: 3.11.1 doesn't seem to read disabled_rules from .editorconfig anymore #262 in mind - does killing gradle daemon with ./gradlew stop change/fix the behaviour you observe?
  4. Are you able to reproduce the same behaviour when running ktlint from CLI? 👀

@jonschmidt
Copy link
Author

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

@mateuszkwiecinski
Copy link
Collaborator

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants