-
Notifications
You must be signed in to change notification settings - Fork 39
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
Canonical constant naming #396
Comments
Hello, I've noticed that to solve this issue, the only global variables that need this change are the Is this issue still relevant? If it is, I would like to try to solve it. :) |
Hi @brunacunha! Good point about Looking at the issue description once more, we might also want to skip package-private fields, as those might be referenced by other classes. All things considered, the issue then calls for a check that:
If you'd like to have a crack at writing such a A possible approach (there are likely others) is to:
If this sounds rather daunting: we can also discuss some easier checks to get started with. 📈 |
Hi!
Even if there would be no cases in Error Prone Support flagged by this |
Hi @rickie , Is this issue still valid? Thanks, |
Hi @BLasan , yes it is! @mohamedsamehsalah is working on it in #794. You would like to work on a ticket of Error Prone Support or are you interested in this particular check? |
Yes @rickie . I would like to work on a ticket of Error Prone Support :) If there's any newbie issue (or any) please let me know. Would be happy to work on it |
Hi @rickie , Will give it a try. Thanks for creating one :) |
Problem
According to the Google Java Format Style guide constants names should use
UPPER_SNAKE_CASE
.There is a
ConstantField
check in Error Prone that does the following:We want to go one step further and ensure that all constant names are
UPPER_SNAKE_CASE
.Description of the proposed new feature
I would like to rewrite the following code:
to:
Considerations
Carefully read the GJF Style Guide on constant names and maybe use examples from there.
This check might require some additional analysis for
static
fields that are mutable. This should be a rare case though. Let's see how we handle this when we get there 😄.The text was updated successfully, but these errors were encountered: