Skip to content

Commit 8b90016

Browse files
EdwardAngertClaude
and
Claude
committed
fix: actually install Vale and enable style checking
- Enable Vale in docs-preview workflow to catch typos and style issues - Fix the Vale installation in unified workflow - Add RepeatedWords.yml rule to catch repeated words like 'the the' - Fix syntax error in .vale.ini file 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent a6b39db commit 8b90016

File tree

5 files changed

+60
-13
lines changed

5 files changed

+60
-13
lines changed

.github/docs/actions/docs-core/action.yaml

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -707,16 +707,49 @@ runs:
707707
exit 0
708708
fi
709709
710-
# Count markdown files for validation
711-
MD_FILES=$(echo "$CHANGED_FILES_JSON" | jq -r '.[]' | grep '\.md$' | wc -l | tr -d ' ')
710+
# Save changed markdown files to a temp file
711+
echo "$CHANGED_FILES_JSON" | jq -r '.[]' | grep '\.md$' > /tmp/vale_files.txt
712+
MD_FILES=$(cat /tmp/vale_files.txt | wc -l | tr -d ' ')
712713
713714
# Log file count for monitoring
714715
echo "Found $MD_FILES markdown files for style checking"
715-
echo "Vale style checking ready"
716716
717-
# Report success for this step
718-
echo "status=success" >> $GITHUB_OUTPUT
719-
echo "message=Style checking is available for $MD_FILES files" >> $GITHUB_OUTPUT
717+
if [ "$MD_FILES" -gt 0 ]; then
718+
# Check if vale is available
719+
if command -v vale &> /dev/null; then
720+
echo "Running Vale style checks on the files"
721+
ISSUES_FOUND=false
722+
723+
# Process each file individually
724+
while read -r file; do
725+
if [ -f "$file" ]; then
726+
echo "Checking style for $file"
727+
if vale --output=line --no-exit .github/docs/vale/.vale.ini "$file"; then
728+
echo "✅ No style issues found in $file"
729+
else
730+
echo "⚠️ Style issues found in $file"
731+
ISSUES_FOUND=true
732+
fi
733+
fi
734+
done < /tmp/vale_files.txt
735+
736+
if [ "$ISSUES_FOUND" = true ]; then
737+
echo "status=warning" >> $GITHUB_OUTPUT
738+
echo "message=Style issues found in documentation" >> $GITHUB_OUTPUT
739+
else
740+
echo "status=success" >> $GITHUB_OUTPUT
741+
echo "message=No style issues found in $MD_FILES files" >> $GITHUB_OUTPUT
742+
fi
743+
else
744+
echo "Vale not available - skipping style checks"
745+
echo "status=skipped" >> $GITHUB_OUTPUT
746+
echo "message=Vale not available for style checking" >> $GITHUB_OUTPUT
747+
fi
748+
else
749+
echo "No markdown files to check"
750+
echo "status=success" >> $GITHUB_OUTPUT
751+
echo "message=No files to check" >> $GITHUB_OUTPUT
752+
fi
720753
721754
echo "::endgroup::"
722755

.github/docs/vale/.vale.ini

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,4 @@ TokenIgnores = (`[^`]+`)
1818

1919
# Exclude generated files and temporary files
2020
IgnoredScopes = code, tt, pre
21-
IgnoredClasses = language-*, MathJax*
22-
EOF < /dev/null
21+
IgnoredClasses = language-*, MathJax*
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
# Rule to detect repeated words
3+
extends: repetition
4+
message: "'%s' is repeated"
5+
level: error
6+
alpha: true
7+
tokens:
8+
- '[^\s]+'

.github/workflows/docs-preview.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
check-cross-references: true # Still check cross-references
2929
lint-markdown: true # Quick check for formatting
3030
check-format: true # Quick check for table formatting
31-
lint-vale: false # Skip style checking for faster preview
31+
lint-vale: true # Enable style checking to catch typos and style issues
3232
generate-preview: true # Always generate preview
3333
post-comment: true # Always post comment
3434
fail-on-error: false # Never fail for preview

.github/workflows/docs-unified.yaml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,16 +125,23 @@ jobs:
125125
./scripts/pnpm_install.sh --prefer-offline || ./scripts/pnpm_install.sh --no-frozen-lockfile
126126
echo "Node.js dependencies installed successfully"
127127
128-
- name: Prepare for Vale
128+
- name: Install Vale
129129
if: steps.docs-core-setup.outputs.needs_vale == 'true'
130130
shell: bash
131131
run: |
132-
echo "Preparing for Vale documentation style checking"
132+
echo "Installing Vale documentation style checker"
133133
# Create Vale directory if needed
134134
mkdir -p .github/docs/vale
135135
136-
# Log that Vale would be used here
137-
echo "Vale would be installed and used for style checking"
136+
# Actually install Vale
137+
curl -sfL https://github.com/errata-ai/vale/releases/download/v2.29.6/vale_2.29.6_Linux_64-bit.tar.gz -o vale.tar.gz
138+
mkdir -p /tmp/vale
139+
tar -xzf vale.tar.gz -C /tmp/vale
140+
sudo mv /tmp/vale/vale /usr/local/bin/vale
141+
rm -rf vale.tar.gz /tmp/vale
142+
143+
# Verify installation
144+
vale -v
138145
139146
# Run the main validation with all tools installed
140147
- name: Run documentation validation

0 commit comments

Comments
 (0)