[PATCH] D39829: add new check for property declaration

2017-11-14 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tidy/objc/PropertyDeclarationCheck.cpp:89 + assert(MatchedDecl->getName().size() > 0); + // Skip the check of lowerCamelCase if the name has prefix of special acronyms + if (startsWithSpecialAcronyms(MatchedDecl->getName(), Spec

[PATCH] D39829: add new check for property declaration

2017-11-13 Thread Ben Hamilton via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL318117: add new check for property declaration (authored by benhamilton). Repository: rL LLVM https://reviews.llvm.org/D39829 Files: clang-tools-extra/trunk/clang-tidy/objc/CMakeLists.txt clang-to

[PATCH] D39829: add new check for property declaration

2017-11-13 Thread Yan Zhang via Phabricator via cfe-commits
Wizard added a comment. LGTM https://reviews.llvm.org/D39829 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D39829: add new check for property declaration

2017-11-13 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added a comment. OK, I updated this diff with the suggested changes. @Wizard, want to take a look before I land? https://reviews.llvm.org/D39829 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailm

[PATCH] D39829: add new check for property declaration

2017-11-13 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton updated this revision to Diff 122739. benhamilton added a comment. - Use regex to match acronym prefixes, update tests https://reviews.llvm.org/D39829 Files: clang-tidy/objc/CMakeLists.txt clang-tidy/objc/ObjCTidyModule.cpp clang-tidy/objc/PropertyDeclarationCheck.cpp clang-

[PATCH] D39829: add new check for property declaration

2017-11-13 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added inline comments. Comment at: clang-tidy/objc/PropertyDeclarationCheck.cpp:89 + assert(MatchedDecl->getName().size() > 0); + // Skip the check of lowerCamelCase if the name has prefix of special acronyms + if (startsWithSpecialAcronyms(MatchedDecl->getName(),

[PATCH] D39829: add new check for property declaration

2017-11-13 Thread Yan Zhang via Phabricator via cfe-commits
Wizard updated this revision to Diff 122714. Wizard marked 2 inline comments as done. Wizard added a comment. address nits https://reviews.llvm.org/D39829 Files: clang-tidy/objc/CMakeLists.txt clang-tidy/objc/ObjCTidyModule.cpp clang-tidy/objc/PropertyDeclarationCheck.cpp clang-tidy/obj

[PATCH] D39829: add new check for property declaration

2017-11-13 Thread Haojian Wu via Phabricator via cfe-commits
hokein accepted this revision. hokein added a comment. This revision is now accepted and ready to land. Looks good to me. I (or @benhamilton) will commit the patch for you if @benhamilton is fine with it. Comment at: clang-tidy/objc/PropertyDeclarationCheck.cpp:22 +namespace {

[PATCH] D39829: add new check for property declaration

2017-11-10 Thread Yan Zhang via Phabricator via cfe-commits
Wizard marked 2 inline comments as done. Wizard added inline comments. Comment at: clang-tidy/objc/PropertyDeclarationCheck.cpp:27 +FixItHint generateFixItHint(const ObjCPropertyDecl *Decl) { + if (isupper(Decl->getName()[0])) { +auto NewName = Decl->getName().str(); ---

[PATCH] D39829: add new check for property declaration

2017-11-10 Thread Yan Zhang via Phabricator via cfe-commits
Wizard updated this revision to Diff 122552. Wizard marked 9 inline comments as done. Wizard added a comment. add custom options https://reviews.llvm.org/D39829 Files: clang-tidy/objc/CMakeLists.txt clang-tidy/objc/ObjCTidyModule.cpp clang-tidy/objc/PropertyDeclarationCheck.cpp clang-ti

[PATCH] D39829: add new check for property declaration

2017-11-10 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added inline comments. Comment at: clang-tidy/objc/PropertyDeclarationCheck.cpp:41 + objcPropertyDecl( + // the property name should be in Lower Camel Case like + // 'lowerCamelCase' benhamilton wrote: > There are some exception

[PATCH] D39829: add new check for property declaration

2017-11-10 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added inline comments. Comment at: clang-tidy/objc/PropertyDeclarationCheck.cpp:41 + objcPropertyDecl( + // the property name should be in Lower Camel Case like + // 'lowerCamelCase' There are some exceptions we should special c

[PATCH] D39829: add new check for property declaration

2017-11-10 Thread Yan Zhang via Phabricator via cfe-commits
Wizard added inline comments. Comment at: test/clang-tidy/objc-property-declaration.m:8 +@property(assign, nonatomic) int camelCase; +// CHECK-MESSAGES-NOT: :[[@LINE-1]]:34: warning: property 'camelCase' is not in proper format according to property naming convention [objc-prop

[PATCH] D39829: add new check for property declaration

2017-11-10 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tidy/objc/PropertyDeclarationCheck.cpp:22 + +/// we will do best effort to generate a fix, however, if the +/// case can not be solved with a simple fix (e.g. CamelCase I think we need to update the comment accordin

[PATCH] D39829: add new check for property declaration

2017-11-09 Thread Yan Zhang via Phabricator via cfe-commits
Wizard added inline comments. Comment at: clang-tidy/objc/PropertyDeclarationCheck.cpp:25 +/// we will do best effort to generate a fix, however, if the +/// case can not be solved with a simple fix (e.g. remove prefix or change first +/// character), we will leave the fix to th

[PATCH] D39829: add new check for property declaration

2017-11-09 Thread Yan Zhang via Phabricator via cfe-commits
Wizard updated this revision to Diff 122319. Wizard marked 6 inline comments as done. Wizard added a comment. address comments https://reviews.llvm.org/D39829 Files: clang-tidy/objc/CMakeLists.txt clang-tidy/objc/ObjCTidyModule.cpp clang-tidy/objc/PropertyDeclarationCheck.cpp clang-tidy

[PATCH] D39829: add new check for property declaration

2017-11-09 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added inline comments. Comment at: clang-tidy/objc/PropertyDeclarationCheck.cpp:25 +/// we will do best effort to generate a fix, however, if the +/// case can not be solved with a simple fix (e.g. remove prefix or change first +/// character), we will leave the fix

[PATCH] D39829: add new check for property declaration

2017-11-09 Thread Ben Hamilton via Phabricator via cfe-commits
benhamilton added inline comments. Comment at: docs/clang-tidy/checks/objc-property-declaration.rst:7 +Finds property declarations in Objective-C files that do not follow the pattern +of property names in Google's Objective-C Style Guide. The property name should +be in the forma

[PATCH] D39829: add new check for property declaration

2017-11-09 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. Next time, please remember to add `cfe-commits` to the subscriber. Comment at: clang-tidy/objc/PropertyDeclarationCheck.cpp:14 + +#include + Do we need this header? Comment at: clang-tidy/objc/PropertyDeclarationCheck