| 1 |
.. title:: clang-tidy - google-objc-function-naming |
| 2 |
|
| 3 |
google-objc-function-naming |
| 4 |
=========================== |
| 5 |
|
| 6 |
Finds function declarations in Objective-C files that do not follow the pattern |
| 7 |
described in the Google Objective-C Style Guide. |
| 8 |
|
| 9 |
The corresponding style guide rule can be found here: |
| 10 |
https://google.github.io/styleguide/objcguide.html#function-names |
| 11 |
|
| 12 |
All function names should be in Pascal case. Functions whose storage class is |
| 13 |
not static should have an appropriate prefix. |
| 14 |
|
| 15 |
The following code sample does not follow this pattern: |
| 16 |
|
| 17 |
.. code-block:: objc |
| 18 |
|
| 19 |
static bool is_positive(int i) { return i > 0; } |
| 20 |
bool IsNegative(int i) { return i < 0; } |
| 21 |
|
| 22 |
The sample above might be corrected to the following code: |
| 23 |
|
| 24 |
.. code-block:: objc |
| 25 |
|
| 26 |
static bool IsPositive(int i) { return i > 0; } |
| 27 |
bool *ABCIsNegative(int i) { return i < 0; } |