kotlinter-gradle icon indicating copy to clipboard operation
kotlinter-gradle copied to clipboard

Better KtLintParseException error description

Open avdyushin opened this issue 2 years ago • 1 comments

In case if code (somehow) has compilation issues (e.g. after merge conflicts), running lintKotlin will give this error:

lint worker execution error
com.pinterest.ktlint.core.api.KtLintParseException: 17:5 Expecting member declaration
	at com.pinterest.ktlint.core.internal.RuleExecutionContext$Companion.createRuleExecutionContext$ktlint_core(RuleExecutionContext.kt:137)
...

Which doesn't clear, what file cause this issue.

avdyushin avatar Jun 05 '23 14:06 avdyushin

Yes, good point. Probably we should catch the error from running the ktlint library and wrap it in a better message indicating which file.

jeremymailen avatar Jun 09 '23 15:06 jeremymailen