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
16 changes: 14 additions & 2 deletions .vale.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
StylesPath = styles
MinAlertLevel = warning

[*.{md}]
# Exclude with more specific patterns
# [!docs/engines/**/*.md]
# [!docs/development/**/*.md]
# [!docs/interfaces/**/*.md]
# [!docs/operations/**/*.md]
# [!docs/sql-reference/**/*.md]
[!docs/whats-new/**/*.md]
[!docs/releases/**/*.md]

# Only check .md files (not .mdx)
[docs/**/*.md]
BasedOnStyles = ClickHouse

ClickHouse.SentenceLength = NO
ClickHouse.FutureTense = NO
41 changes: 41 additions & 0 deletions scripts/vale/vale-report.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/bash
# vale-report.sh - Generate Vale report

vale docs/ \
--glob='!docs/whats-new/**/*.md' \
--output=JSON > vale-report.json 2>&1

# Check if vale-report.json is valid JSON
if ! jq empty vale-report.json 2>/dev/null; then
echo "Error: Vale did not produce valid JSON output"
echo ""
echo "Vale output:"
cat vale-report.json
exit 1
fi

echo "================================================"
echo "Vale Report - $(date '+%Y-%m-%d')"
echo "================================================"
echo ""

WARNINGS=$(jq '[.[] | .[] | select(.Severity == "warning")] | length' vale-report.json)
SUGGESTIONS=$(jq '[.[] | .[] | select(.Severity == "suggestion")] | length' vale-report.json)

echo "Warnings: $WARNINGS"
echo "Suggestions: $SUGGESTIONS"
echo ""

echo "Top Warning Rules:"
jq -r '[.[] | .[] | select(.Severity == "warning") | .Check] | group_by(.) | map({rule: .[0], count: length}) | sort_by(-.count) | .[:5] | .[] | "\(.count)\t\(.rule)"' vale-report.json | column -t -s $'\t'
echo ""

echo "Top Files to Fix:"
jq -r 'to_entries | map({file: .key, count: [.value[] | select(.Severity == "warning")] | length}) | map(select(.count > 0)) | sort_by(-.count) | .[:15] | .[] | "\(.count)\t\(.file)"' vale-report.json | column -t -s $'\t'
echo ""

echo "================================================"
echo "To fix a file:"
echo " vale docs/path/to/file.md"
echo " vim docs/path/to/file.md"
echo "================================================"
2 changes: 1 addition & 1 deletion styles/ClickHouse/CodeblockFences.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ extends: existence
message: "Instead of '%s' for the code block, use yaml, ruby, plaintext, markdown, javascript, shell, go, python, dockerfile, or typescript."
link: https://docs.gitlab.com/development/documentation/styleguide/#code-blocks
vocab: false
level: warning
level: suggestion
scope: raw
raw:
- '\`\`\`(yml|rb|text|md|bash|sh\n|js\n|golang\n|py\n|docker\n|ts|irb)'
2 changes: 1 addition & 1 deletion styles/ClickHouse/FutureTense.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ message: "Instead of future tense '%s', use present tense."
ignorecase: true
nonword: true
vocab: false
level: warning
level: suggestion
link: https://docs.gitlab.com/development/documentation/styleguide/word_list/#future-tense
tokens:
- (going to|will|won't)[ \n:]\w*
Expand Down
3 changes: 3 additions & 0 deletions styles/ClickHouse/Uppercase.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ first: '\b([A-Z]{3,5})\b'
second: '(?:\b[A-Z][a-z]+ )+\(([A-Z]{3,5})\)'
# ... with the exception of these:
exceptions:
- ACH
- ACL
- AJAX
- ALL
Expand Down Expand Up @@ -163,6 +164,7 @@ exceptions:
- OTP
- OWASP
- PAT
- PAYG
- PCI-DSS
- PDF
- PEM
Expand Down Expand Up @@ -255,6 +257,7 @@ exceptions:
- URI
- URL
- USB
- USD
- UTC
- UTF
- UUID
Expand Down