Skip to content

Commit 3a8eaac

Browse files
feat: exclude false positive modules from modules check
1 parent d0ac39c commit 3a8eaac

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

scripts/check_modules.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,9 @@ def check_modules():
373373
# Search for "modules: [" in README
374374
found_modules_string = search_in_file(
375375
file_path, "modules: [")
376-
if found_modules_string:
376+
false_positive_modules = ["MMM-pages", "MMM-WebSpeechTTS"]
377+
378+
if found_modules_string and module["name"] not in false_positive_modules:
377379
module["issues"].append(
378380
"Recommendation: The README seems to have a modules array (Found `modules: [`). This is usually not necessary. Please remove it if it is not needed."
379381
)
@@ -384,17 +386,19 @@ def check_modules():
384386
)
385387

386388
if not found_config_string:
387-
if not found_modules_string:
389+
false_positive_modules = ["MMM-CalendarExt2"]
390+
if not found_modules_string and module["name"] not in false_positive_modules:
388391
module["issues"].append(
389392
"Recommendation: The README seems not to have a config example. Please add one."
390393
)
391394
else:
392395
# Check if the config example has an trailing comma
393396
found_trailing_comma = search_regex_in_file(
394397
file_path, r"\{\s*[^}]*?\s*config:\s*\{\s*[^}]*\}(?:[,\s]\s*[^}]*?)},")
395-
if not found_trailing_comma:
398+
false_positive_modules = ["MMM-Remote-Control"]
399+
if not found_trailing_comma and module["name"] not in false_positive_modules:
396400
module["issues"].append(
397-
"Recommendation: The README seems to have a config example with out a trailing comma. Please add one."
401+
"Recommendation: The README seems to have a config example without a trailing comma. Please add one."
398402
)
399403

400404
if len(module["issues"]) < 1:

0 commit comments

Comments
 (0)