Skip to content

Commit

Permalink
Allow optional whitespace at the start of "commented out" config lines
Browse files Browse the repository at this point in the history
  • Loading branch information
lurch committed Nov 25, 2024
1 parent 54e30d8 commit 60c6786
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tools/extract_build_defines.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def ValidateAttrs(config_name, config_attrs, file_path, linenum):
elif BASE_BUILD_DEFINE_RE.search(line):
m = BUILD_DEFINE_RE.match(line)
if not m:
if line.startswith("## "):
if re.match(r"^\s*#\s*# ", line):
logger.info("Possible misformatted {} at {}:{} ({})".format(BASE_BUILD_DEFINE_NAME, file_path, linenum, line))
else:
raise Exception("Found misformatted {} at {}:{} ({})".format(BASE_BUILD_DEFINE_NAME, file_path, linenum, line))
Expand Down
2 changes: 1 addition & 1 deletion tools/extract_cmake_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def ValidateAttrs(config_name, config_attrs, file_path, linenum):
elif BASE_CMAKE_CONFIG_RE.search(line):
m = CMAKE_CONFIG_RE.match(line)
if not m:
if line.startswith("## "):
if re.match("^\s*#\s*# ", line):
logger.info("Possible misformatted {} at {}:{} ({})".format(BASE_CMAKE_CONFIG_NAME, file_path, linenum, line))
else:
raise Exception("Found misformatted {} at {}:{} ({})".format(BASE_CMAKE_CONFIG_NAME, file_path, linenum, line))
Expand Down
2 changes: 1 addition & 1 deletion tools/extract_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def ValidateAttrs(config_name, config_attrs, file_path, linenum):
elif BASE_CONFIG_RE.search(line):
m = CONFIG_RE.match(line)
if not m:
if line.startswith("//// "):
if re.match(r"^\s*//\s*// ", line):
logger.info("Possible misformatted {} at {}:{} ({})".format(BASE_CONFIG_NAME, file_path, linenum, line))
else:
raise Exception("Found misformatted {} at {}:{} ({})".format(BASE_CONFIG_NAME, file_path, linenum, line))
Expand Down

0 comments on commit 60c6786

Please sign in to comment.