Skip to content

Commit 193b2bd

Browse files
feat: enhance README config example check to avoid false negatives
1 parent 65e2519 commit 193b2bd

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

scripts/check_modules.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -382,10 +382,12 @@ def check_modules():
382382
found_config_string = search_regex_in_file(
383383
file_path, r"\{\s*[^}]*?\s*config:\s*\{\s*[^}]*\}(?:[,\s]\s*[^}]*?)}"
384384
)
385+
385386
if not found_config_string:
386-
module["issues"].append(
387-
"Recommendation: The README seems not to have a config example. Please add one."
388-
)
387+
if not found_modules_string:
388+
module["issues"].append(
389+
"Recommendation: The README seems not to have a config example. Please add one."
390+
)
389391
else:
390392
# Check if the config example has an trailing comma
391393
found_trailing_comma = search_regex_in_file(

0 commit comments

Comments
 (0)