From 50e791f920bbb984970a1214fbdf862d9b19221f Mon Sep 17 00:00:00 2001 From: Tanner Doshier Date: Wed, 13 Nov 2024 11:15:35 -0500 Subject: [PATCH] bin/lint-markdown: Only run against git-tracked markdown files Rather than maintaining effectively another ignore list, use the one we already have via git. This also adapts better to usage in child projects, as they will likely have more language/project specific locations to ignore that we can't realistically maintain in this parent template. --- bin/lint-markdown | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/bin/lint-markdown b/bin/lint-markdown index c3049fa3..49923a6b 100755 --- a/bin/lint-markdown +++ b/bin/lint-markdown @@ -18,6 +18,4 @@ else link_check_cmd="npx markdown-link-check" fi -# Recursively find all markdown files (*.md) in the current directory, excluding node_modules and .venv subfolders. -# Pass them in as args to the lint command using the handy `xargs` command. -find . -name \*.md -not -path "*/node_modules/*" -not -path "*/.venv/*" -not -path "*/.terraform/*" -print0 | xargs -0 -I{} sh -c "${link_check_cmd} --quiet --config ${link_check_config} {}" +git ls-files -z '*.md' | xargs -0 -I{} sh -c "${link_check_cmd} --quiet --config ${link_check_config} {}"