summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test/clang-tidy/objc-property-declaration.m
Commit message (Collapse)AuthorAgeFilesLines
* [ClangTidy] Separate tests for infrastructure and checkersDmitri Gribenko2019-10-111-55/+0
| | | | | | | | | | | | | | | | | | | | Summary: This change moves tests for checkers and infrastructure into separate directories, making it easier to find infrastructure tests. Tests for checkers are already easy to find because they are named after the checker. Tests for infrastructure were difficult to find because they were outnumbered by tests for checkers. Now they are in a separate directory. Reviewers: jfb, jdoerfert, lebedev.ri Subscribers: srhines, nemanjai, aheejin, kbarton, christof, mgrang, arphaman, jfb, lebedev.ri, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D68807 llvm-svn: 374540
* Update property prefix regex to allow numbers.Yan Zhang2019-02-201-0/+1
| | | | | | | | Subscribers: jfb, cfe-commits Differential Revision: https://reviews.llvm.org/D56896 llvm-svn: 354485
* [clang-tidy/checks] Update objc-property-declaration check to allow ↵Stephane Moore2018-12-051-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | arbitrary acronyms and initialisms 🔧 Summary: §1 Description This changes the objc-property-declaration check to allow arbitrary acronyms and initialisms instead of using whitelisted acronyms. In Objective-C it is relatively common to use project prefixes in property names for the purposes of disambiguation. For example, the CIColor¹ and CGColor² properties on UIColor both represent symbol prefixes being used in proeprty names outside of Apple's accepted acronyms³. The union of Apple's accepted acronyms and all symbol prefixes that might be used for disambiguation in property declarations effectively allows for any arbitrary sequence of capital alphanumeric characters to be acceptable in property declarations. This change updates the check accordingly. The test variants with custom configurations are deleted as part of this change because their configurations no longer impact behavior. The acronym configurations are currently preserved for backwards compatibility of check configuration. [1] https://developer.apple.com/documentation/uikit/uicolor/1621951-cicolor?language=objc [2] https://developer.apple.com/documentation/uikit/uicolor/1621954-cgcolor?language=objc [3] https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/CodingGuidelines/Articles/APIAbbreviations.html#//apple_ref/doc/uid/20001285-BCIHCGAE §2 Test Notes Changes verified by: • Running clang-tidy unit tests. • Used check_clang_tidy.py to verify expected output of processing objc-property-declaration.m Reviewers: benhamilton, Wizard Reviewed By: benhamilton Subscribers: jfb, cfe-commits Differential Revision: https://reviews.llvm.org/D51832 llvm-svn: 348331
* Fix the issue that not recognizing single acronym with prefix as ObjC ↵Yan Zhang2018-11-011-0/+1
| | | | | | | | | | | | | | | | property name. Summary: This will make clang-tidy accept property names like xyz_URL (URL is a common acronym). Reviewers: benhamilton, hokein Reviewed By: benhamilton Subscribers: jfb, cfe-commits Differential Revision: https://reviews.llvm.org/D53955 llvm-svn: 345858
* - Add "AV" as new default acronym. - Add support for "I" and "A" in ↵Yan Zhang2018-06-111-0/+1
| | | | | | | | | | | | | | | | 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
* Add support for ObjC property name to be a single acronym.Yan Zhang2018-05-041-0/+1
| | | | | | | | | | | | | | | | | | | | | Summary: This change will support cases like: ``` @property(assign, nonatomic) int ID; ``` Reviewers: benhamilton, hokein Reviewed By: benhamilton Subscribers: klimek, cfe-commits Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D46374 llvm-svn: 331545
* [clang-tidy] Add Apple prefix acronyms to objc-property-declarationBen Hamilton2018-05-011-0/+2
| | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 331267
* add extra acronyms for objc property namesYan Zhang2018-04-181-0/+2
| | | | | | | | | | | | | | Summary: This is to support general acronyms in Objective-C like 2G/3G/4G/... and coordinates X, Y, Z and W. Reviewers: benhamilton Reviewed By: benhamilton Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D45750 llvm-svn: 330286
* Support special acronyms inside property names and allow plural formsYan Zhang2018-02-061-0/+3
| | | | | | | | | | | | Reviewers: benhamilton, hokein Reviewed By: benhamilton, hokein Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D42947 llvm-svn: 324407
* add prefix with '_' support for property name. Corresponding apple dev doc: ↵Yan Zhang2018-01-301-2/+22
| | | | | | | | | | | | | | https://developer.apple.com/library/content/qa/qa1908/_index.html Reviewers: benhamilton, hokein Reviewed By: benhamilton Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D42464 llvm-svn: 323722
* [clang-tidy objc-property-declaration] Expand list of ObjC acronymsBen Hamilton2018-01-181-0/+4
| | | | | | | | | | | | | | | | | | | | | Summary: 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 Reviewers: Wizard, hokein, klimek Reviewed By: Wizard Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D42253 llvm-svn: 322886
* add ID as a special acronym to objc property declaration check for property ↵Yan Zhang2018-01-171-0/+1
| | | | | | | | | | | | | | names like bundleID.allow using acronyms as suffix. Reviewers: benhamilton, hokein Reviewed By: benhamilton Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D42143 llvm-svn: 322602
* add new check for property declarationBen Hamilton2017-11-131-0/+12
Summary: This check finds property declarations in Objective-C files that do not follow the pattern of property names in Apple's programming guide. The property name should be in the format of Lower Camel Case or with some particular acronyms as prefix. Example: @property(nonatomic, assign) int lowerCamelCase; @property(nonatomic, strong) NSString *URLString; Test plan: ninja check-clang-tools Reviewers: benhamilton, hokein Reviewed By: hokein Subscribers: cfe-commits, mgorny Differential Revision: https://reviews.llvm.org/D39829 llvm-svn: 318117
OpenPOWER on IntegriCloud