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
Crashes on random files when running with formatting enabled #5348
Comments
Hi, could you try to disable Are you sure this is the complete stacktrace? Cause by NullPointer seems to miss tacktraces. |
Or, is there any line pointing to ktlint? |
It seems like the culprit is the
When this rule is present, |
Complete stacktrace:
|
uff the stacktrace really does not help. |
Like I said multiple times, it does not crash when using autoCorrect = false I managed to get a different stacktrace with parallel = false (I already had it before but decided not to report in the original post because I thought that was an intermittent issue)
But the task will still fail occasionally with NPE even with parallel = false, stacktrace:
I think these are the same ones but something goes wrong with exception cause handling. |
The stacktrace also hints at ktlint formatting, similar issue when running it via cli #5247 Could you try to disable the following, to see if it also fixes your issue: formatting:
active: true
autoCorrect: true
Indentation:
active: false # this works |
Actually, I already had this rule disabled before, so the issue happens with or without Indentation rule enabled (it was disabled because it conflicted in an unresolvable way with IDEAs formatting). But right now I'm using release version of detekt 1.22.0 and I can't reproduce this crash anymore. P.S. Sorry for the long answer |
Expected Behavior
Running detekt format task completes normally
Observed Behavior
I observe crashes on random files, not being able to predict which one will crash for each subsequent launch. Common stack traces are:
Steps to Reproduce
I'm using a custom task to format whole project
Context
This issue started happening immediately after upgrading to 1.22.0-RC.
Crashes happen on seemingly random files, even on ones with very little code inside.
Issue happens with both parallel=false and true
Detekt task without formatting enabled completes fine.
Your Environment
--scan
option when running the gradle task): Not willing to discloseThe text was updated successfully, but these errors were encountered: