From b128ceb16127ec9c817595aaa64c025b9e5ed12e Mon Sep 17 00:00:00 2001 From: Etienne Millon Date: Tue, 23 Jul 2013 21:07:51 +0200 Subject: [PATCH] tidy: allow arbitrary spaces between // and NOTE `make tidy` now detects `//NOTE`, `// NOTE`, etc. This also removes the extra empty line emitted after each warning. Fixes #6060 --- src/etc/tidy.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/etc/tidy.py b/src/etc/tidy.py index 06fcb5cb94586..4815bc601f69a 100644 --- a/src/etc/tidy.py +++ b/src/etc/tidy.py @@ -49,9 +49,9 @@ def do_license_check(name, contents): report_err("FIXME without issue number") if line.find("TODO") != -1: report_err("TODO is deprecated; use FIXME") - idx = line.find("// NOTE") - if idx != -1: - report_warn("NOTE" + line[idx + len("// NOTE"):]) + match = re.match(r'^.*//\s*(NOTE.*)$', line) + if match: + report_warn(match.group(1)) if (line.find('\t') != -1 and fileinput.filename().find("Makefile") == -1): report_err("tab character")