From 4ea770fdfddcb9efa75a40550aae77ba779486e0 Mon Sep 17 00:00:00 2001 From: kenkangxgwe Date: Thu, 1 Jun 2023 01:22:39 -0700 Subject: [PATCH] The base_name should fully match the exclude_files pattern Previously, a path in the same directory as the CPPLINT.cfg is excluded if one of its prefixes matches the pattern, which leads some confusing cases like "exclude_files=l" excluding "libs". Now we should change the pattern to "exclude_files=l.*" to achieve the same result. --- cpplint/cpplint.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpplint/cpplint.py b/cpplint/cpplint.py index 704618f53..d9cb57fde 100755 --- a/cpplint/cpplint.py +++ b/cpplint/cpplint.py @@ -5989,7 +5989,7 @@ def ProcessConfigOverrides(filename): # and not "baz" nor "bar/baz.cc". if base_name: pattern = re.compile(val) - if pattern.match(base_name): + if pattern.fullmatch(base_name): if _cpplint_state.quiet: # Suppress "Ignoring file" warning when using --quiet. return False