[PATCH] D46206: [clang-tidy] Add Apple prefix acronyms to objc-property-declaration

Ben Hamilton via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 27 12:49:05 PDT 2018


benhamilton created this revision.
benhamilton added reviewers: Wizard, hokein.
Herald added subscribers: cfe-commits, xazax.hun, klimek.

This adds a few common Apple first-party API prefixes as acronyms to
`objc-property-declaration`.

Here's a list showing where these come from:

http://nshipster.com/namespacing/

Test Plan: New tests added. Ran tests with:

  % make -j16 check-clang-tools


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D46206

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
@@ -19,6 +19,8 @@
 @property(strong, nonatomic) NSString *VCsPluralToAdd;
 @property(assign, nonatomic) int centerX;
 @property(assign, nonatomic) int enable2GBackgroundFetch;
+ at property(assign, nonatomic) int shouldUseCFPreferences;
+ at property(assign, nonatomic) int enableGLAcceleration;
 @end
 
 @interface Foo (Bar)
Index: clang-tidy/objc/PropertyDeclarationCheck.cpp
===================================================================
--- clang-tidy/objc/PropertyDeclarationCheck.cpp
+++ clang-tidy/objc/PropertyDeclarationCheck.cpp
@@ -45,11 +45,17 @@
     "ARGB",
     "ASCII",
     "BGRA",
+    "CA",
+    "CF",
+    "CG",
+    "CI",
+    "CV",
     "CMYK",
     "DNS",
     "FPS",
     "FTP",
     "GIF",
+    "GL",
     "GPS",
     "GUID",
     "HD",
@@ -65,6 +71,7 @@
     "LZW",
     "MDNS",
     "MIDI",
+    "NS",
     "OS",
     "PDF",
     "PIN",
@@ -81,6 +88,7 @@
     "RPC",
     "RTF",
     "RTL",
+    "SC",
     "SDK",
     "SSO",
     "TCP",


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D46206.144387.patch
Type: text/x-patch
Size: 1179 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180427/4449ceec/attachment-0001.bin>


More information about the cfe-commits mailing list