[PATCH] D51575: [clang-tidy] Implement a clang-tidy check to verify Google Objective-C function naming conventions 📜

Ben Hamilton via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 5 14:09:08 PDT 2018


benhamilton added inline comments.


================
Comment at: clang-tidy/google/FunctionNamingCheck.cpp:35
+  // non-standard capitalized character sequences including acronyms,
+  // initialisms, and prefixes of symbols (e.g., UIColorFromNSString). For this
+  // reason, the regex only verifies that the function name after the prefix
----------------
benhamilton wrote:
> Any reason why this is different from the implementation in the property name checker? Either we should allow both of:
> 
> ```
> void ARBiTraRilyNameDFuncTioN();
> // ...
> @property (...) id arBItrArIlyNameD;
> ```
> 
> or we should require that acronyms in the middle of the name be registered/known acronyms for both properties and functions.
> 
> I believe this diff allows arbitrary capitalization for functions, but we disallowed that for property names, so I think we should be consistent.
(And, just to be clear, I don't feel strongly which direction we go — it's certainly less work to allow arbitrarily-named functions and properties than to maintain the acronym list.)



Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D51575





More information about the cfe-commits mailing list