Fix prefix check script 33/92433/8
authorAnil Belur <abelur@linuxfoundation.org>
Thu, 10 Sep 2020 08:04:23 +0000 (18:04 +1000)
committerAnil Belur <abelur@linuxfoundation.org>
Thu, 10 Sep 2020 21:39:24 +0000 (07:39 +1000)
Fix the prefix check that matches any line with "prefix:"
that fails tox.

The prefix check fails on the following line
which is valid.

failure-notification-prefix: "[releng]"

require a space before prefix: now it cannot match
failure-notification-prefix:

Change-Id: I2d5ee1eb7c858bd5eac03af02f44db2f4a9e46a8
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
check_prefix.py

index 08f83653d98f7b34a79baaf22e66ee783baf114b..de561981c5f6f0491526457a0e84e3e5497274b8 100755 (executable)
@@ -24,7 +24,7 @@ def check_prefix(filename):
     """Check if a prefix was checked into this repo."""
     with open(filename, "r") as _file:
         for num, line in enumerate(_file, 1):
-            if re.search("prefix:", line):
+            if re.search(r"^\s+prefix:", line):
                 if '""' not in line:
                     print(
                         "ERROR: A non-blank prefix is defined in "