From c35b010a3f6b5bc35c519be9a996b7ff9b771b7a Mon Sep 17 00:00:00 2001 From: Fu Hanxi Date: Fri, 24 Apr 2020 11:03:35 +0800 Subject: [PATCH] improve regex --- tools/ci/check_build_warnings.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/ci/check_build_warnings.py b/tools/ci/check_build_warnings.py index 738d3f299..3db99e8b1 100755 --- a/tools/ci/check_build_warnings.py +++ b/tools/ci/check_build_warnings.py @@ -18,7 +18,7 @@ except ImportError: sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..")) from find_build_apps import BuildItem, setup_logging -WARNING_REGEX = r"^\s+(?:error|warning)" +WARNING_REGEX = re.compile(r"^\s*(?:error|warning)", re.MULTILINE | re.IGNORECASE) IGNORE_WARNS = [ re.compile(r_str) for r_str in [ @@ -34,7 +34,7 @@ IGNORE_WARNS = [ def line_has_warnings(line): # type: (str) -> bool - if not re.search(WARNING_REGEX, line): + if not WARNING_REGEX.search(line): return False has_warnings = True