[PATCH] D48039: - Add "AV" as new default acronym. - Add support for "I" and "A" in lowerCamelCase pattern

Yan Zhang via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 11 11:19:09 PDT 2018


Wizard created this revision.
Herald added a subscriber: cfe-commits.
Wizard edited the summary of this revision.
Wizard added reviewers: benhamilton, hokein.

Now we can support property names like "hasADog" correctly.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D48039

Files:
  clang-tidy/objc/PropertyDeclarationCheck.cpp
  test/clang-tidy/objc-property-declaration.m


Index: test/clang-tidy/objc-property-declaration.m
===================================================================
--- test/clang-tidy/objc-property-declaration.m
+++ test/clang-tidy/objc-property-declaration.m
@@ -22,6 +22,7 @@
 @property(assign, nonatomic) int shouldUseCFPreferences;
 @property(assign, nonatomic) int enableGLAcceleration;
 @property(assign, nonatomic) int ID;
+ at property(assign, nonatomic) int hasADog;
 @end
 
 @interface Foo (Bar)
Index: clang-tidy/objc/PropertyDeclarationCheck.cpp
===================================================================
--- clang-tidy/objc/PropertyDeclarationCheck.cpp
+++ clang-tidy/objc/PropertyDeclarationCheck.cpp
@@ -45,6 +45,7 @@
     "AR",
     "ARGB",
     "ASCII",
+    "AV",
     "BGRA",
     "CA",
     "CF",
@@ -153,7 +154,7 @@
   std::string StartMatcher = UsedInMatcher ? "::" : "^";
   std::string AcronymsMatcher = AcronymsGroupRegex(EscapedAcronyms);
   return StartMatcher + "(" + AcronymsMatcher + "[A-Z]?)?[a-z]+[a-z0-9]*(" +
-         AcronymsMatcher + "|([A-Z][a-z0-9]+))*$";
+         AcronymsMatcher + "|([A-Z][a-z0-9]+)|A|I)*$";
 }
 
 bool hasCategoryPropertyPrefix(llvm::StringRef PropertyName) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48039.150797.patch
Type: text/x-patch
Size: 1181 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180611/420da761/attachment.bin>


More information about the cfe-commits mailing list