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

Error with kotlin 2.0.1 #809

Open
nckdistributable opened this issue Nov 29, 2024 · 4 comments
Open

Error with kotlin 2.0.1 #809

nckdistributable opened this issue Nov 29, 2024 · 4 comments

Comments

@nckdistributable
Copy link

nckdistributable commented Nov 29, 2024

Hi, I'm getting an error when executing the ktlintCheck task. The error is:

Execution failed for task ':runKtlintCheckOverKotlinScripts'.
> A failure occurred while executing org.jlleitschuh.gradle.ktlint.worker.KtLintWorkAction
   > Class org.jetbrains.kotlin.lexer.KtTokens does not have member field 'org.jetbrains.kotlin.lexer.KtModifierKeywordToken HEADER_KEYWORD'

I found that this keyword was removed in the most recent versions of the Kotlin compiler. Is the current version of ktlint aware of this?

Thanks!

@cbartolome
Copy link

This might be about Kotlin 2.1.0, not 2.0.1.

@gmmoreira
Copy link

This error has been fixed in ktlint lib version 1.4.0, but this plugin is using an slightly older version of the lib.

In build.gradle.kts we can configure the plugin to use the most recent version of ktlint.

ktlint {
    version.set("1.4.1")
}

That should fix the error for now.

@JLLeitschuh
Copy link
Owner

A PR updating the default Ktlint version would be appreciated and accepted with a simple unit test and a CHANGELOG entry

@CPColin
Copy link

CPColin commented Dec 9, 2024

I hope this PR is what you were looking for: #818

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

5 participants