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
Do not report PascalCase top-level constants in property-naming rule #2636
Comments
Ktlint is following the recommendations of Android Kotlin Style Guide when using code_style Based on Baseline style guidelines of Jetpack Compose you should use default kotlin coding style (code_style = The exception for Singletons, constants, sealed class and enum class values defined in Jetpack Compose can best be dealt with by disabling this rule in the |
Right. I tried in IntelliJ IDEA and it's not reported as well, so this as a conflict between ktlint and IntelliJ IDEA.
Understandable. Disabling the rule is what I'm doing now, but that also disables the linting of other non-constant properties. |
Opened #2637. |
Expected Behavior
A top-level constant with a name in PascalCase (e.g.
private const val SomeConstant = 100
) shouldn't be reported as a violation.I'm using
android_studio
style and latest stable version of Android Studio (2023.2.1 Patch 2) doesn't report this.PascalCase is the style recommended by API Guidelines for Jetpack Compose.
By the way, the recommendation also applies to properties of
object
s, so it would be great to fix that as well, but that case is also reported by AS, though.Observed Behavior
The following violation is reported:
Property name should use the screaming snake case notation when the value can not be changed
.Steps to Reproduce
Simply
private const val SomeConstant = 100
.Your Environment
.editorconfig
settingsThe text was updated successfully, but these errors were encountered: