§1 Description
This check finds function names in function declarations in Objective-C files that do not follow the naming pattern described in the Google Objective-C Style Guide. Function names should be in UpperCamelCase and functions that are not of static storage class should have an appropriate prefix as described in the Google Objective-C Style Guide. The function main is a notable exception. Function declarations in expansions in system headers are ignored.
Example conforming function definitions:
static bool IsPositive(int i) { return i > 0; } static bool ABIsPositive(int i) { return i > 0; } bool ABIsNegative(int i) { return i < 0; }
A fixit hint is generated for functions of static storage class but otherwise the check does not generate a fixit hint because an appropriate prefix for the function cannot be determined.
§2 Test Notes
- Verified clang-tidy tests pass successfully.
- Used check_clang_tidy.py to verify expected output of processing google-objc-function-naming.m
Worth mentioning this does not apply to Objective-C method names, nor Objective-C properties.