-
Notifications
You must be signed in to change notification settings - Fork 50
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
LintTask doesn't rerun when editorconfig changes #233
Comments
It seems like the plugin should declare @joshmsamuels As a temp workaround I can suggest you to add your val editorconfigFile = rootProject.file(".editorconfig") // or whatever the file location is.
tasks.withType<LintTask> {
inputs.file(editorconfigFile).withPathSensitivity(PathSensitivity.RELATIVE)
} |
That worked 🎉 Thank you so much! Is there a way to define this for all kotlinter tasks instead of just the lint task? It looks like I have to copy the same function for the |
I think we can keep the issue open, as that's still a bug in the plugin and should be fixed at some point 👀
I don't think you have to define such patch for * - Unless you use Configuration Cache, but I'm guessing you don't |
Yes, as @mateuszkwiecinski points out, the gap here is that editorconfig is not currently an Input to the LintTask, so you have to force a rerun if you change the rules there. Incremental build should behave correctly in all other cases. I changed the issue title accordingly. It would be nice to resolve the path to editorconfig and use it as an input in the plugin. Currently the resolution and reading of editorconfig is delegated to the underlying ktlint library. Yes, FormatTask does not attempt to be incremental. If memory serves, doing so would make it unpredictable because sometimes it changes the input files themselves and sometimes it does not. |
Thanks for the clarification! I also have a shared |
I have been trying to configure kotlinter with my
.editorconfig
and I was having problems gettingkotlinter
to respect my rules since it looks like the lint task is being persistently cached.Every time I make a
.editorconfig
change and runbuild
, the change gets picked up by kotlinter, however, every time I runLintTask
, whether right after a gradle clean or with./gradlew clean lintKotlin
it says there are no issues even though there are lint errors since I changed theeditorconfig
rules.As a temporary work-around, #112 (comment) helped me prevent the
ListTask
from caching when I run./gradlew lintKotlin --rerun-tasks
.This issue makes me lose confidence in the
prePushHook
or other linter automation since I will never know if the linter truly should have succeeded, so are there any permanent solutions to this issue?The text was updated successfully, but these errors were encountered: