[PATCH] D39829: add new check for property declaration
Ben Hamilton via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Nov 10 08:28:28 PST 2017
benhamilton added inline comments.
Comment at: clang-tidy/objc/PropertyDeclarationCheck.cpp:41
+ // the property name should be in Lower Camel Case like
+ // 'lowerCamelCase'
> There are some exceptions we should special case. Acronyms like `URL` and `HTTP` and `HTML` are allowed at the beginning of method names (and property names—although that is not explicitly mentioned, property names follow the same guidelines as method names):
> > For method names, start with a lowercase letter and capitalize the first letter of embedded words. Don’t use prefixes.
> > `fileExistsAtPath:isDirectory:`
> > An exception to this guideline is method names that start with a well-known acronym, for example, `TIFFRepresentation` (NSImage).
> There is a list of well-known acronyms listed here:
Probably the right thing to do is make this a configuration option, the same way I did with `objc-forbidden-subclassing`, and default to the above list.
More information about the cfe-commits