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

Separate constant naming rule from property-naming #2637

Open
mxalbert1996 opened this issue Apr 17, 2024 · 1 comment
Open

Separate constant naming rule from property-naming #2637

mxalbert1996 opened this issue Apr 17, 2024 · 1 comment

Comments

@mxalbert1996
Copy link

mxalbert1996 commented Apr 17, 2024

Expected Rule behavior

Ktlint reports PascalCase constant names as violations, in compliance with Kotlin/Android style guide. If we want to use PascalCase for constants, we need to disable the rule, but the linting of other non-constant properties is also disabled. It would be great if the naming rule for constants can be separated so that we can disable that rule only.

Since PascalCase is recommended by Baseline style guidelines of Jetpack Compose, I think this is a rather common need.

Additional information

@paul-dingemans
Copy link
Collaborator

I am not sure about splitting the rule. An alternative could be to add a configuration parameter to the rule that defines the format to be used for constants. This configuration parameter should then allow values SCREAMING_CASE (default) and PASCAL_CASE.

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

2 participants