docs: sync consolidation and session starter
This commit is contained in:
31
scripts/docs/docs_lint.sh
Executable file
31
scripts/docs/docs_lint.sh
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
||||
cd "$ROOT_DIR"
|
||||
|
||||
if ! command -v npx >/dev/null 2>&1; then
|
||||
echo "npx not found; install Node.js to run markdown lint" >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
echo "Running markdown lint on tracked markdown files"
|
||||
|
||||
scope_file="docs/standards/lint_scope.txt"
|
||||
if [[ ! -f "$scope_file" ]]; then
|
||||
echo "Missing lint scope file: $scope_file" >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
mapfile -t scope_paths < <(sed '/^\s*$/d; /^\s*#/d' "$scope_file")
|
||||
files=()
|
||||
for p in "${scope_paths[@]}"; do
|
||||
[[ -f "$p" ]] && files+=("$p")
|
||||
done
|
||||
|
||||
if [[ "${#files[@]}" -eq 0 ]]; then
|
||||
echo "No markdown files to lint"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
npx -y markdownlint-cli2 --config .markdownlint.yml "${files[@]}"
|
||||
Reference in New Issue
Block a user