Skip to content

Commit 13397fe

Browse files
feat: add checks for clone instructions in README
1 parent 0ded2f1 commit 13397fe

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

scripts/check_modules.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ def check_modules():
365365
f"Recommendation: Found `{search_string}` in file `{file_path.name}`: Config would be cleaner using 'stylelint-prettier/recommended'. [See here](https://github.com/prettier/stylelint-prettier)."
366366
)
367367

368-
if file_path.name.startswith("README") and file_path.parent == module_directory_path:
368+
if file_path.name == "README.md" and file_path.parent == module_directory_path:
369369
# Search for an update section in README
370370
found_update_section = search_in_file(
371371
file_path, "## Updat")
@@ -412,6 +412,22 @@ def check_modules():
412412
module["issues"].append(
413413
"Recommendation: The README seems to have a config example without a trailing comma. Please add one ([basic instructions](https://github.com/MagicMirrorOrg/MagicMirror-3rd-Party-Modules/blob/main/guides/readme_bestpractices.md#Config-Instructions))."
414414
)
415+
416+
# Search for clone instructions in README
417+
found_clone_instructions = search_in_file(
418+
file_path, "git clone")
419+
if not found_clone_instructions:
420+
module["issues"].append(
421+
"Recommendation: The README seems not to have clone instructions."
422+
)
423+
else:
424+
# Check if repo URL is correct
425+
found_repo_url = search_in_file(
426+
file_path, f"git clone {module['url']}")
427+
if not found_repo_url:
428+
module["issues"].append(
429+
"Recommendation: The README seems to have incorrect clone instructions. Please check the URL."
430+
)
415431

416432
if len(module["issues"]) < 1:
417433
if ".yml" in str(file_path).lower():

0 commit comments

Comments
 (0)