[cpplint] Ignore fn_size check for macros with digits
In the cpplint fn_size check, there's a part where it explicitly
says to ignore macros, BUT the check for macro names didn't allow
for digits, which are present in the IPC_* macro names, which
look like "IPC_SYNC_MESSAGE_CONTROL4_1".
There are two interesting things about this:
1. This bug was filed in 2011! Yay for fixing a 5-digit crbug with
one-line fix!
2. This is a great example of how cpplint's regex-based checking is
error-prone compared to something that actually has access to an
abstract syntax tree.
Bug: 83036
Change-Id: I49acd80c265d7f7bc633f2092388525b4518ae23
Reviewed-on: https://chromium-review.googlesource.com/c/1483283
Reviewed-by: Marc-Antoine Ruel <maruel@chromium.org>
Commit-Queue: Quinten Yearsley <qyearsley@chromium.org>
diff --git a/cpplint.py b/cpplint.py
index 670c285..8a85c9e 100755
--- a/cpplint.py
+++ b/cpplint.py
@@ -2955,7 +2955,7 @@
# ignore it, unless it's TEST or TEST_F.
function_name = match_result.group(1).split()[-1]
if function_name == 'TEST' or function_name == 'TEST_F' or (
- not Match(r'[A-Z_]+$', function_name)):
+ not Match(r'[A-Z_0-9]+$', function_name)):
starting_func = True
if starting_func: