Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions docs-linter/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ MD_CLEAN=$(mktemp)
# --- GATHER FILES ---
echo "🎯 Gathering files from '$TARGET_DIR'..."

# CHANGE 1: Added |_partials to the exclusion list to fix MD041 errors on snippets
find "$TARGET_DIR" -type f \( -name "*.md" -o -name "*.mdx" \) \
| grep -vE "/(node_modules|_remotes|versioned_docs|_partials)/" \
| grep -vE "/(node_modules|versioned_docs)/" \
| grep -v "/_" \
> "$LIST_FILE"

FILE_COUNT=$(wc -l < "$LIST_FILE")
Expand Down Expand Up @@ -101,12 +101,11 @@ fi
if [ -s "$VALE_CLEAN" ]; then
echo "####################### VALE REPORT #######################"
cat "$VALE_CLEAN"
# If Markdownlint failed, remind the user right after Vale's "All Good" message
if [ "$MD_ERR" -gt 0 ]; then
echo "🛑 BUT WAIT! You also have $MD_ERR Markdownlint errors (see above)."
fi
echo ""
fi

# --- REMOVE TEMP FILES ---
rm "$LIST_FILE" "$VALE_LOG" "$MD_LOG" "$VALE_CLEAN" "$MD_CLEAN"
rm "$LIST_FILE" "$VALE_LOG" "$MD_LOG" "$VALE_CLEAN" "$MD_CLEAN"
8 changes: 3 additions & 5 deletions unified-doc/build-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ lint_docs() {
return
fi

# 3. GENERATE CLEAN FILE LIST (Restored exactly as it was)
# 3. GENERATE CLEAN FILE LIST
echo "🎯 Gathering file list..."
LIST_FILE=$(mktemp)

Expand All @@ -136,6 +136,8 @@ lint_docs() {
| grep -v "/versioned_docs/" \
| grep -v "/build/" \
| grep -v "/.git/" \
| grep -v "/_partials/" \
| grep -v "/_[^/]*$" \
> "$LIST_FILE"

FILE_COUNT=$(wc -l < "$LIST_FILE")
Expand Down Expand Up @@ -170,12 +172,9 @@ lint_docs() {
fi

# 5. FORMAT & CLEAN LOGS

# Format Vale: Strip absolute paths, strip color codes
VALE_CLEAN=$(mktemp)
sed "s|.*/_remotes/|_remotes/|g" "$VALE_LOG" | sed 's/\x1b\[[0-9;]*m//g' > "$VALE_CLEAN"

# Format Markdownlint: Strip absolute paths, strip color codes, AND Group by Filename
MDLINT_CLEAN=$(mktemp)
sed "s|.*/_remotes/|_remotes/|g" "$MDLINT_LOG" | sed 's/\x1b\[[0-9;]*m//g' | \
awk -F: '
Expand Down Expand Up @@ -216,7 +215,6 @@ lint_docs() {
echo "####################### VALE REPORT #######################"
cat "$VALE_CLEAN"

# The "Reality Check" Line
if [ "$MD_ERR" -gt 0 ]; then
echo "🛑 BUT WAIT! You also have $MD_ERR Markdownlint errors (see above)."
fi
Expand Down