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

Lint task sometimes does not re-run when editorconfig changes #327

Closed
jeremymailen opened this issue May 7, 2023 · 7 comments · Fixed by #358
Closed

Lint task sometimes does not re-run when editorconfig changes #327

jeremymailen opened this issue May 7, 2023 · 7 comments · Fixed by #358

Comments

@jeremymailen
Copy link
Owner

Although we are supposed to consider the editorconfig file contents a build input and re-run lint tasks when it changes, somehow this isn't happening sometimes. It often leads users to perceive that one of their editorconfig settings is not working.
Reference #324 and #321

@jeremymailen jeremymailen changed the title Lint task sometimes does not run with editorconfig changes Lint task sometimes does not re-run when editorconfig changes May 7, 2023
@christophsturm
Copy link

This problem happens to me all of the time. I don't know where the editorconfig file is cached but git clean -fxd fixes it for me.

@stopal
Copy link

stopal commented Jun 13, 2023

I stumbled across this problem too upgrading to kotlinter-gradle 3.15.0 -> Ktlint 0.49.1.

This problem happens to me all of the time. I don't know where the editorconfig file is cached but git clean -fxd fixes it for me.

Unfortunately this doesnt do the trick for me. Really strange.

@realdadfish
Copy link
Contributor

I also accidentally stumbled upon this trying out different configurations (i.e. changing .editorconfig, running formatKotlin, checking results, reverting changes, and starting again from step 1), and the behaviour was pretty much reproducible, however I was unable to debug into the plugin's code via -Dorg.gradle.debug=true, as for some reason my breakpoints weren't hit.

Anyways, for me it helped stopping the Gradle daemon in between runs or start formatKotlin right away with -Dorg.gradle.daemon=false.

@bravik
Copy link

bravik commented Dec 21, 2023

./gradlew --stop && ./gradlew :link:lintKotlin

@jeremymailen
Copy link
Owner Author

Yeah, this is clearly a bug, but I need to find time to track it down and fix it. PRs welcome if someone else sees the solution.

@mateuszkwiecinski
Copy link
Contributor

I'm unable to create a PR, but I can link the root cause:

protected fun getChangedEditorconfigFiles(inputChanges: InputChanges) = if (inputChanges.isIncremental) {
inputChanges.getFileChanges(editorconfigFiles).map(FileChange::getFile)
} else {
emptyList()
}
- the if should be dropped. The exact failing scenario (with a bit of explanation) can be found on kotlinlang slack

@jeremymailen
Copy link
Owner Author

Thanks @mateuszkwiecinski I can definitely make a PR when I get back home from the holidays.
You should still have permission to make PRs, merge, release etc since you're still a contributor but if you're running into trouble I can try to fix whatever's gone wrong.

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

Successfully merging a pull request may close this issue.

6 participants