[clang-tidy/checks] Update objc-property-declaration check to allow arbitrary acronym...
authorStephane Moore <mog@google.com>
Wed, 5 Dec 2018 03:44:03 +0000 (03:44 +0000)
committerStephane Moore <mog@google.com>
Wed, 5 Dec 2018 03:44:03 +0000 (03:44 +0000)
commitaf4755aca8adeb64e6527d4bf1bf697535a083ad
tree701571722194d37bf3dbab412beec3475de6783a
parent6934202dc04ffa5ff336a1cca9ace8dae44c29d4
[clang-tidy/checks] Update objc-property-declaration check to allow 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
clang-tools-extra/clang-tidy/objc/PropertyDeclarationCheck.cpp
clang-tools-extra/docs/ReleaseNotes.rst
clang-tools-extra/docs/clang-tidy/checks/objc-property-declaration.rst
clang-tools-extra/test/clang-tidy/objc-property-declaration-additional.m [deleted file]
clang-tools-extra/test/clang-tidy/objc-property-declaration-custom.m [deleted file]
clang-tools-extra/test/clang-tidy/objc-property-declaration.m