diff options
author | Yan Zhang <ynzhang@google.com> | 2018-06-11 22:44:06 +0000 |
---|---|---|
committer | Yan Zhang <ynzhang@google.com> | 2018-06-11 22:44:06 +0000 |
commit | 72cecf9a63032d53a57e39eefcea58dd4217fdbc (patch) | |
tree | 32d0d06dee377a6fad2f475f3afc06b2e56e279f | |
parent | a0c0857e7a2398237d00a13ad9ac7078c0148578 (diff) | |
download | bcm5719-llvm-72cecf9a63032d53a57e39eefcea58dd4217fdbc.tar.gz bcm5719-llvm-72cecf9a63032d53a57e39eefcea58dd4217fdbc.zip |
- Add "AV" as new default acronym. - Add support for "I" and "A" in lowerCamelCase pattern
Summary: Now we can support property names like "hasADog" correctly.
Reviewers: benhamilton, hokein
Reviewed By: benhamilton
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D48039
llvm-svn: 334448
-rw-r--r-- | clang-tools-extra/clang-tidy/objc/PropertyDeclarationCheck.cpp | 3 | ||||
-rw-r--r-- | clang-tools-extra/test/clang-tidy/objc-property-declaration.m | 1 |
2 files changed, 3 insertions, 1 deletions
diff --git a/clang-tools-extra/clang-tidy/objc/PropertyDeclarationCheck.cpp b/clang-tools-extra/clang-tidy/objc/PropertyDeclarationCheck.cpp index 8bc77f5f1af..dc15bdbe43f 100644 --- a/clang-tools-extra/clang-tidy/objc/PropertyDeclarationCheck.cpp +++ b/clang-tools-extra/clang-tidy/objc/PropertyDeclarationCheck.cpp @@ -45,6 +45,7 @@ constexpr llvm::StringLiteral DefaultSpecialAcronyms[] = { "AR", "ARGB", "ASCII", + "AV", "BGRA", "CA", "CF", @@ -153,7 +154,7 @@ std::string validPropertyNameRegex(llvm::ArrayRef<std::string> EscapedAcronyms, 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) { diff --git a/clang-tools-extra/test/clang-tidy/objc-property-declaration.m b/clang-tools-extra/test/clang-tidy/objc-property-declaration.m index ede14426df9..7f70784d354 100644 --- a/clang-tools-extra/test/clang-tidy/objc-property-declaration.m +++ b/clang-tools-extra/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; +@property(assign, nonatomic) int hasADog; @end @interface Foo (Bar) |