You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since I really like the idea of using one fixed and common set of rules defined by a dependency, esp. when developing spring based applications, I was wondering why naming checks are not included in the default checkstyle rule set. I know those are common sense, but esp. for new Java devs, maybe also coming from different languages like Python, it would be great to also enforce these rules:
Most of these look sensible and I'd like to try them. We might need some tweaks to *ParameterName because we sometimes want to go beyond a single letter.
I'm not sure that we can apply the ConstantName rule. I think the rule is wrong for a lot of Spring Code because staticfinal alone isn't enough to determine if something is a constant.
For example, I consider static final String[] NO_STRINGS to be a constant because it can't change.
But, static final Map<String, String> cache isn't really a constant and shouldn't be written as CACHE.
I'm also not sure about CatchParameterName. We tend to use ex for all exceptions and throwables and we already have SpringCatchCheck to enforce some rules.
Interesting take on the ConstantName. I always struggle to find the right balance there. Do you see a static final Logger as a constant? Maybe this rule can be restricted via type (primitives, arrays)? Or maybe I'm overthinking this and some things should be done in the review and cannot be enforced upfront.
Regarding the CatchParameterName, or the single letter in general. Till now, I often went with single letters like e or t but again, maybe a good way to be more expressive there. Didn't notice the SpringCatchCheck before though. I'll consider to adapt to this pattern.
Since I really like the idea of using one fixed and common set of rules defined by a dependency, esp. when developing spring based applications, I was wondering why naming checks are not included in the default checkstyle rule set. I know those are common sense, but esp. for new Java devs, maybe also coming from different languages like Python, it would be great to also enforce these rules:
What do you think?
The text was updated successfully, but these errors were encountered: