Skip to content

Commit 60c6786

Browse files
committed
Allow optional whitespace at the start of "commented out" config lines
1 parent 54e30d8 commit 60c6786

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

tools/extract_build_defines.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ def ValidateAttrs(config_name, config_attrs, file_path, linenum):
139139
elif BASE_BUILD_DEFINE_RE.search(line):
140140
m = BUILD_DEFINE_RE.match(line)
141141
if not m:
142-
if line.startswith("## "):
142+
if re.match(r"^\s*#\s*# ", line):
143143
logger.info("Possible misformatted {} at {}:{} ({})".format(BASE_BUILD_DEFINE_NAME, file_path, linenum, line))
144144
else:
145145
raise Exception("Found misformatted {} at {}:{} ({})".format(BASE_BUILD_DEFINE_NAME, file_path, linenum, line))

tools/extract_cmake_configs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ def ValidateAttrs(config_name, config_attrs, file_path, linenum):
139139
elif BASE_CMAKE_CONFIG_RE.search(line):
140140
m = CMAKE_CONFIG_RE.match(line)
141141
if not m:
142-
if line.startswith("## "):
142+
if re.match("^\s*#\s*# ", line):
143143
logger.info("Possible misformatted {} at {}:{} ({})".format(BASE_CMAKE_CONFIG_NAME, file_path, linenum, line))
144144
else:
145145
raise Exception("Found misformatted {} at {}:{} ({})".format(BASE_CMAKE_CONFIG_NAME, file_path, linenum, line))

tools/extract_configs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ def ValidateAttrs(config_name, config_attrs, file_path, linenum):
158158
elif BASE_CONFIG_RE.search(line):
159159
m = CONFIG_RE.match(line)
160160
if not m:
161-
if line.startswith("//// "):
161+
if re.match(r"^\s*//\s*// ", line):
162162
logger.info("Possible misformatted {} at {}:{} ({})".format(BASE_CONFIG_NAME, file_path, linenum, line))
163163
else:
164164
raise Exception("Found misformatted {} at {}:{} ({})".format(BASE_CONFIG_NAME, file_path, linenum, line))

0 commit comments

Comments
 (0)