-
Notifications
You must be signed in to change notification settings - Fork 743
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
MemberName
checks class names too
#4616
Comments
None of those should, in principle, be controversial inside Google. Google's Java style guide has very well-defined (and as you can tell from Of course, though, external users are not at all bound by our style guide. Would it be useful to just disable this entire check for third-party users? The entire thing is enforcing the style guide, which really ought to be opt-in. |
Hmm, that would be a shame, as for actual member names I so far have never seen it emit a suggestion I'd consider suppressing. Additionally, users who disagree with the rule as a whole can also just set it to (While I'd still prefer one of the other suggestions made, ) I suppose the minimal change this issue advocates for would be to rename the check, as it now focusses on more than members. On our side I'll review whether we should turn the check back on and (perhaps) add selective suppressions instead. NB: It'd be nice to see the style guide take an explicit stance of type names derived from |
@graememorgan I see that |
I don't think we'd be too motivated to implement carved-out exemptions to the style guide. Internally, the style guide is meant to be viewed as entirely non-negotiable. I'd be happy to accept a PR to flag class checking though.
I think it does take a stance on it by not providing an exemption. |
Tnx! Based on this "somehow different but not sure why" feeling I proposed a PR that only allows users to opt-out of initialism checking in type names: #4646. I realize that this is rather niche, but there seems value in having the check unconditionally flag type names with underscores and those not starting with a capital letter. |
As of 43ed6f3, the
MemberName
check also flags type names. Resolving such violations is often much more involved than renaming (private) field names, possibly even prohibitive due to compatibility requirements.Additionally, some of the suggestions are possibly controversial:
MoreASTHelpers
toMoreAstHelpers
, while it relates toASTHelpers
.AssertThatThrownByIOException
toAssertThatThrownByIoException
, while this Refaster rule relates to Java's built-inIOException
type.TestNGToAssertJRules
toTestNgToAssertJRules
, while the associated testing framework is named TestNG, not TestNg.MongoDbTextFilterUsage
toMongoDbTextFilterUsage
, while the database is named MongoDB, not MongoDb.Suggestion: perhaps this type name logic can be moved to a separate check, with a more suitable name. Otherwise, what about allowing the type name logic to be disabled using a flag?
CC @graememorgan.
The text was updated successfully, but these errors were encountered: