We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
package some.package enum class TestEnum(val someField: String) { A("a"), B("b"), C("c"); companion object { fun findBySomeField(field: String): TestEnum? = values().find { it.someField == field } } }
If run this snipped of code with ktlint v0.48.0, you'll get the following output:
/path/to/TestEnum.kt:6:11: Unnecessary semicolon (no-semi) /path/to/TestEnum.kt:6:11: Missing trailing comma before ";" (trailing-comma-on-declaration-site) Summary error count (descending) by rule: no-semi: 1 trailing-comma-on-declaration-site: 1
Telling ktlint to resolve the issues by running ktlint -F /path/to/TestEnum.kt produces the following code:
ktlint -F /path/to/TestEnum.kt
package some.package enum class TestEnum(val someField: String) { A("a"), B("b"), C("c") companion object { fun findBySomeField(field: String): TestEnum? = values().find { it.someField == field } }, }
which is an invalid code:
.editorconfig
The text was updated successfully, but these errors were encountered:
Duplicate of #1733
Sorry, something went wrong.
No branches or pull requests
If run this snipped of code with ktlint v0.48.0, you'll get the following output:
Telling ktlint to resolve the issues by running
ktlint -F /path/to/TestEnum.kt
produces the following code:which is an invalid code:
Your Environment
.editorconfig
settings: not usedThe text was updated successfully, but these errors were encountered: