add extra acronyms for objc property names
authorYan Zhang <ynzhang@google.com>
Wed, 18 Apr 2018 20:09:10 +0000 (20:09 +0000)
committerYan Zhang <ynzhang@google.com>
Wed, 18 Apr 2018 20:09:10 +0000 (20:09 +0000)
Summary: This is to support general acronyms in Objective-C like 2G/3G/4G/... and coordinates X, Y, Z and W.

Reviewers: benhamilton

Reviewed By: benhamilton

Subscribers: klimek, cfe-commits

Differential Revision: https://reviews.llvm.org/D45750

llvm-svn: 330286

clang-tools-extra/clang-tidy/objc/PropertyDeclarationCheck.cpp
clang-tools-extra/test/clang-tidy/objc-property-declaration.m

index 7a3bbaf..ae9ca01 100644 (file)
@@ -39,6 +39,7 @@ enum NamingStyle {
 ///
 /// Keep this list sorted.
 constexpr llvm::StringLiteral DefaultSpecialAcronyms[] = {
+    "[2-9]G",
     "ACL",
     "API",
     "ARGB",
@@ -93,8 +94,12 @@ constexpr llvm::StringLiteral DefaultSpecialAcronyms[] = {
     "VOIP",
     "VPN",
     "VR",
+    "W",
     "WAN",
+    "X",
     "XML",
+    "Y",
+    "Z",
 };
 
 /// For now we will only fix 'CamelCase' or 'abc_CamelCase' property to
index 0eb6188..5e52808 100644 (file)
@@ -17,6 +17,8 @@
 @property(strong, nonatomic) NSString *supportURLsCamelCase;
 @property(strong, nonatomic) NSString *supportURLCamelCase;
 @property(strong, nonatomic) NSString *VCsPluralToAdd;
+@property(assign, nonatomic) int centerX;
+@property(assign, nonatomic) int enable2GBackgroundFetch;
 @end
 
 @interface Foo (Bar)