feat: add markdown validation and auto-fix scripts
- Create validate-markdown.sh for compliance checking - Add fix-markdown.sh for automatic formatting fixes - Exclude node_modules from validation scope - Integrate with npm scripts for easy usage
This commit is contained in:
19
scripts/fix-markdown.sh
Executable file
19
scripts/fix-markdown.sh
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
echo "🔧 Auto-fixing markdown formatting..."
|
||||
|
||||
# Check if markdownlint is available
|
||||
if ! command -v npx &> /dev/null; then
|
||||
echo "❌ npx not found. Please install Node.js and npm first."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Run markdownlint with auto-fix on project markdown files (exclude node_modules)
|
||||
echo "📝 Fixing project markdown files..."
|
||||
npx markdownlint "*.md" "*.mdc" "scripts/**/*.md" "src/**/*.md" "test-playwright/**/*.md" "resources/**/*.md" --config .markdownlint.json --fix 2>/dev/null || {
|
||||
echo "⚠️ Some issues could not be auto-fixed. Check manually."
|
||||
}
|
||||
|
||||
echo "✅ Markdown auto-fix complete!"
|
||||
echo "💡 Run 'npm run markdown:check' to verify all issues are resolved."
|
||||
19
scripts/validate-markdown.sh
Executable file
19
scripts/validate-markdown.sh
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
echo "🔍 Validating markdown formatting..."
|
||||
|
||||
# Check if markdownlint is available
|
||||
if ! command -v npx &> /dev/null; then
|
||||
echo "❌ npx not found. Please install Node.js and npm first."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Run markdownlint on project markdown files (exclude node_modules)
|
||||
echo "📝 Checking project markdown files..."
|
||||
npx markdownlint "*.md" "*.mdc" "scripts/**/*.md" "src/**/*.md" "test-playwright/**/*.md" "resources/**/*.md" --config .markdownlint.json 2>/dev/null || {
|
||||
echo "❌ Markdown validation failed. Run 'npm run markdown:fix' to auto-fix issues."
|
||||
exit 1
|
||||
}
|
||||
|
||||
echo "✅ All markdown files pass validation!"
|
||||
Reference in New Issue
Block a user