[PATCH] D55482: [clang-tidy] Improve google-objc-function-naming diagnostics 📙
Ben Hamilton via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Dec 10 15:47:56 PST 2018
benhamilton accepted this revision.
benhamilton added a comment.
This revision is now accepted and ready to land.
Thanks, just minor suggestions.
================
Comment at: clang-tidy/google/FunctionNamingCheck.cpp:114-118
diag(MatchedDecl->getLocation(),
- "function name %0 not using function naming conventions described by "
- "Google Objective-C style guide")
- << MatchedDecl << generateFixItHint(MatchedDecl);
+ "%select{static|global}1 function name %0 must %select{be in|have an "
+ "appropriate prefix followed by}1 Pascal case as required by Google "
+ "Objective-C style guide")
+ << MatchedDecl << IsGlobal << generateFixItHint(MatchedDecl);
----------------
Should we suggest making the function static when it fails this check? (I assume the vast majority of functions which fail this check should really be static.)
================
Comment at: clang-tidy/google/FunctionNamingCheck.cpp:115
diag(MatchedDecl->getLocation(),
- "function name %0 not using function naming conventions described by "
- "Google Objective-C style guide")
- << MatchedDecl << generateFixItHint(MatchedDecl);
+ "%select{static|global}1 function name %0 must %select{be in|have an "
+ "appropriate prefix followed by}1 Pascal case as required by Google "
----------------
I know "global" is the correct name, but I feel like "non-static" might be clearer to folks dealing with these error messages.
WDYT?
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D55482/new/
https://reviews.llvm.org/D55482
More information about the cfe-commits
mailing list