Skip to content

Commit 0c7fbd1

Browse files
jacob-wienecke-nxpkartben
authored andcommitted
scripts: ci: check_compliance.py: Fix check_disallowed_defconfigs: Windows
#78615 Added a check for disallowed Kconfigs which does not work on Windows machines. Windows machines seem to behave differently when faced with the \b word boundary marker. I have removed the \b word boundary marker from the grep commands when os.name=='nt'. The script performs the same as before for any other os. Signed-off-by: Jacob Wienecke <jacob.wienecke@nxp.com>
1 parent f87f2dc commit 0c7fbd1

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

scripts/ci/check_compliance.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -720,8 +720,14 @@ def check_disallowed_defconfigs(self, kconf):
720720
disallowed_regex = "(" + "|".join(disallowed_symbols.keys()) + ")$"
721721

722722
# Warning: Needs to work with both --perl-regexp and the 're' module
723-
regex_boards = r"\bCONFIG_[A-Z0-9_]+\b(?!\s*##|[$@{(.*])"
724-
regex_socs = r"\bconfig\s+[A-Z0-9_]+$"
723+
# Windows
724+
if os.name == 'nt':
725+
# Remove word boundaries on Windows implementation
726+
regex_boards = r"CONFIG_[A-Z0-9_]+(?!\s*##|[$@{(.*])"
727+
regex_socs = r"config[ \t]+[A-Z0-9_]+"
728+
else:
729+
regex_boards = r"\bCONFIG_[A-Z0-9_]+\b(?!\s*##|[$@{(.*])"
730+
regex_socs = r"\bconfig\s+[A-Z0-9_]+$"
725731

726732
grep_stdout_boards = git("grep", "--line-number", "-I", "--null",
727733
"--perl-regexp", regex_boards, "--", ":boards",

0 commit comments

Comments
 (0)