[clang-tools-extra] r331267 - [clang-tidy] Add Apple prefix acronyms to objc-property-declaration

Ben Hamilton via cfe-commits cfe-commits at lists.llvm.org
Tue May 1 07:48:51 PDT 2018


Author: benhamilton
Date: Tue May  1 07:48:51 2018
New Revision: 331267

URL: http://llvm.org/viewvc/llvm-project?rev=331267&view=rev
Log:
[clang-tidy] Add Apple prefix acronyms to objc-property-declaration

Summary:
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

Reviewers: Wizard, hokein

Subscribers: klimek, xazax.hun, cfe-commits

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

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

Modified: clang-tools-extra/trunk/clang-tidy/objc/PropertyDeclarationCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/objc/PropertyDeclarationCheck.cpp?rev=331267&r1=331266&r2=331267&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/objc/PropertyDeclarationCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/objc/PropertyDeclarationCheck.cpp Tue May  1 07:48:51 2018
@@ -45,11 +45,17 @@ constexpr llvm::StringLiteral DefaultSpe
     "ARGB",
     "ASCII",
     "BGRA",
+    "CA",
+    "CF",
+    "CG",
+    "CI",
+    "CV",
     "CMYK",
     "DNS",
     "FPS",
     "FTP",
     "GIF",
+    "GL",
     "GPS",
     "GUID",
     "HD",
@@ -65,6 +71,7 @@ constexpr llvm::StringLiteral DefaultSpe
     "LZW",
     "MDNS",
     "MIDI",
+    "NS",
     "OS",
     "PDF",
     "PIN",
@@ -81,6 +88,7 @@ constexpr llvm::StringLiteral DefaultSpe
     "RPC",
     "RTF",
     "RTL",
+    "SC",
     "SDK",
     "SSO",
     "TCP",

Modified: clang-tools-extra/trunk/test/clang-tidy/objc-property-declaration.m
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/objc-property-declaration.m?rev=331267&r1=331266&r2=331267&view=diff
==============================================================================
--- clang-tools-extra/trunk/test/clang-tidy/objc-property-declaration.m (original)
+++ clang-tools-extra/trunk/test/clang-tidy/objc-property-declaration.m Tue May  1 07:48:51 2018
@@ -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)




More information about the cfe-commits mailing list