benhamilton created this revision.
benhamilton added reviewers: Wizard, hokein, klimek.
Herald added a subscriber: cfe-commits.

We were missing some pretty common acronyms in the camelCase
property name check objc-property-declaration.

This expands the list and sorts it lexicographically, so we can
avoid duplicates.

Test Plan: make -j12 check-clang-tools


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D42253

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
@@ -1,13 +1,17 @@
 // RUN: %check_clang_tidy %s objc-property-declaration %t
+@class NSData;
 @class NSString;
+@class UIViewController;
 
 @interface Foo
 @property(assign, nonatomic) int NotCamelCase;
 // CHECK-MESSAGES: :[[@LINE-1]]:34: warning: property name 'NotCamelCase' should use lowerCamelCase style, according to the Apple Coding Guidelines [objc-property-declaration]
 // CHECK-FIXES: @property(assign, nonatomic) int notCamelCase;
 @property(assign, nonatomic) int camelCase;
 @property(strong, nonatomic) NSString *URLString;
 @property(strong, nonatomic) NSString *bundleID;
+@property(strong, nonatomic) NSData *RGBABytes;
+@property(strong, nonatomic) UIViewController *notificationsVC;
 @property(strong, nonatomic) NSString *URL_string;
 // CHECK-MESSAGES: :[[@LINE-1]]:40: warning: property name 'URL_string' should use lowerCamelCase style, according to the Apple Coding Guidelines [objc-property-declaration]
 @end
Index: clang-tidy/objc/PropertyDeclarationCheck.cpp
===================================================================
--- clang-tidy/objc/PropertyDeclarationCheck.cpp
+++ clang-tidy/objc/PropertyDeclarationCheck.cpp
@@ -24,25 +24,63 @@
 namespace {
 /// The acronyms are from
 /// https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/CodingGuidelines/Articles/APIAbbreviations.html#//apple_ref/doc/uid/20001285-BCIHCGAE
+///
+/// Keep this list sorted.
 constexpr char DefaultSpecialAcronyms[] =
+    "ACL;"
+    "API;"
+    "ARGB;"
     "ASCII;"
-    "PDF;"
-    "XML;"
+    "BGRA;"
+    "CMYK;"
+    "DNS;"
+    "FPS;"
+    "FTP;"
+    "GIF;"
+    "GPS;"
+    "HD;"
+    "HDR;"
     "HTML;"
-    "URL;"
-    "RTF;"
     "HTTP;"
-    "TIFF;"
+    "HTTPS;"
+    "HUD;"
+    "ID;"
     "JPG;"
-    "PNG;"
-    "GIF;"
+    "JS;"
+    "LAN;"
     "LZW;"
-    "ROM;"
-    "RGB;"
-    "CMYK;"
+    "MDNS;"
     "MIDI;"
-    "FTP;"
-    "ID";
+    "OS;"
+    "PDF;"
+    "PIN;"
+    "PNG;"
+    "POI;"
+    "PSTN;"
+    "PTR;"
+    "QA;"
+    "QOS;"
+    "RGB;"
+    "RGBA;"
+    "RGBX;"
+    "ROM;"
+    "RPC;"
+    "RTF;"
+    "RTL;"
+    "SDK;"
+    "SSO;"
+    "TCP;"
+    "TIFF;"
+    "TTS;"
+    "UI;"
+    "URI;"
+    "URL;"
+    "VC;"
+    "VOIP;"
+    "VPN;"
+    "VR;"
+    "WAN;"
+    "XML";
 
 /// For now we will only fix 'CamelCase' property to
 /// 'camelCase'. For other cases the users need to
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to