aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2018-07-19 19:47:06 +0200
committerNeels Hofmeyr <neels@hofmeyr.de>2018-07-19 19:47:07 +0200
commit16515ddc78fce017f3b577f0a58e0f0288d1512e (patch)
tree22ea448f70f2201225992b05674776c54b90edda
parent7eec2dab31f7058b0d97f7bfd7d243a02f02358f (diff)
scripts/verify_log_statements.py: fix regex
Would miss those where the fmt string starts on a new line. Change-Id: If61a36a014a799b94030e5e08a50dfef4207a8a2
-rwxr-xr-xscripts/verify_log_statements.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/verify_log_statements.py b/scripts/verify_log_statements.py
index e7752e1..48f406b 100755
--- a/scripts/verify_log_statements.py
+++ b/scripts/verify_log_statements.py
@@ -18,8 +18,8 @@ import os.path
# This regex matches the entire LOGxx(...) statement over multiple lines.
# It pinpoints the format string by looking for the first arg that contains quotes.
# It then matches any number of separate quoted strings, and accepts 0 or more args after that.
-log_statement_re = re.compile(r'^[ \t]*LOG[_A-Z]+\(([^";,]*,)* *(("[^"]*"[^";,]*)*)(,[^;]*|)\);',
- re.MULTILINE | re.DOTALL)
+log_statement_re = re.compile(r'^[ \t]*LOG[_A-Z]+\(([^";,]*,)*[ \t\r\n]*(("[^"]*"[^";,]*)*)(,[^;]*|)\);',
+ re.MULTILINE | re.DOTALL)
fmt_re = re.compile(r'("[^"]*".*)*fmt')
errors_found = 0