Skip to content

Commit f1b0723

Browse files
authored
Update and rename harper.yml to docs-quality.yml
1 parent 978660e commit f1b0723

1 file changed

Lines changed: 24 additions & 5 deletions

File tree

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,22 @@ jobs:
3838
import os
3939
import sys
4040
41-
with open("cspell-report.json", encoding="utf-8") as f:
42-
data = json.load(f)
41+
try:
42+
with open("cspell-report.json", encoding="utf-8") as f:
43+
content = f.read().strip()
44+
except FileNotFoundError:
45+
content = ""
46+
47+
if not content:
48+
print("::error::cspell-report.json is empty. Check the previous step's log for the actual cspell error (e.g. missing cspell.json or project-words.txt).")
49+
sys.exit(1)
50+
51+
try:
52+
data = json.loads(content)
53+
except json.JSONDecodeError:
54+
print("::error::cspell-report.json is not valid JSON. Raw output was:")
55+
print(content[:2000])
56+
sys.exit(1)
4357
4458
issues = data.get("issues", [])
4559
for issue in issues:
@@ -54,12 +68,17 @@ jobs:
5468
sys.exit(1 if issues and not allow_failure else 0)
5569
PY
5670
57-
grammar:
71+
heading-case:
5872
runs-on: ubuntu-latest
5973
steps:
6074
- uses: actions/checkout@v6
61-
- uses: actions/cache@v4
62-
with:
75+
- run: |
76+
python check_heading_case.py docs src/pages || {
77+
if [ "$ALLOW_FAILURE" = "true" ]; then
78+
exit 0
79+
fi
80+
exit 1
81+
} with:
6382
path: |
6483
~/.cargo/bin
6584
~/.cargo/registry

0 commit comments

Comments
 (0)