Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
060fd31
Harper
Amanda-dong Jul 9, 2026
d9930bd
Update docs-quality.yml
Amanda-dong Jul 9, 2026
23bc447
Update _typos.toml with new configurations
Amanda-dong Jul 9, 2026
342bbfc
Update docs-quality.yml
Amanda-dong Jul 9, 2026
d0f1572
Update docs-quality.yml
Amanda-dong Jul 9, 2026
78a1d72
Update docs-quality.yml
Amanda-dong Jul 9, 2026
702083d
Update Docs Quality workflow for Harper checks
Amanda-dong Jul 9, 2026
1c64c78
Enhance docs quality workflow with caching and reporting
Amanda-dong Jul 10, 2026
c931d00
Rename workflow and add typos job
Amanda-dong Jul 10, 2026
e168229
Update docs-quality.yml
Amanda-dong Jul 10, 2026
1eb3089
Update docs-quality.yml
Amanda-dong Jul 10, 2026
f57d4be
Update docs-quality.yml
Amanda-dong Jul 10, 2026
9c9f731
Update docs quality workflow for improvements
Amanda-dong Jul 10, 2026
0eb37ab
Update docs-quality.yml
Amanda-dong Jul 10, 2026
550a666
Refactor linting logic in docs-quality workflow
Amanda-dong Jul 10, 2026
28d8a7e
Update docs-quality.yml
Amanda-dong Jul 10, 2026
afb553e
Update docs-quality.yml
Amanda-dong Jul 10, 2026
5a9209f
Update docs-quality.yml
Amanda-dong Jul 10, 2026
573987b
Update docs-quality.yml
Amanda-dong Jul 11, 2026
78961d0
Update docs-quality.yml
Amanda-dong Jul 11, 2026
d5a0881
Update docs-quality.yml
Amanda-dong Jul 11, 2026
18b9fa4
Update docs-quality.yml
Amanda-dong Jul 11, 2026
83f2e85
Update docs-quality.yml
Amanda-dong Jul 11, 2026
c233729
Refactor Docs Quality workflow for better checks
Amanda-dong Jul 11, 2026
0b602a1
Add test heading to harpertestfile.md
Amanda-dong Jul 11, 2026
89ae26d
Delete docs/hpc/harpertestfile.md
Amanda-dong Jul 11, 2026
7734503
Create harpertestfile.md
Amanda-dong Jul 11, 2026
41fa090
Update docs-quality.yml
Amanda-dong Jul 12, 2026
4671b3a
Update docs-quality.yml
Amanda-dong Jul 12, 2026
c47a795
Delete docs/hpc/harpertestfile.md
Amanda-dong Jul 12, 2026
db0f302
Add test file for HPC documentation
Amanda-dong Jul 12, 2026
0337431
Rename testfile.md to harpertestfile.md
Amanda-dong Jul 12, 2026
68e2f9b
Update docs-quality.yml
Amanda-dong Jul 12, 2026
6a481c5
Update docs-quality.yml
Amanda-dong Jul 14, 2026
63a6d5d
Update docs-quality.yml
Amanda-dong Jul 14, 2026
2fa8f0b
Update harpertestfile.md
Amanda-dong Jul 15, 2026
06bdbc5
Update heading style in harpertestfile.md
Amanda-dong Jul 15, 2026
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
129 changes: 129 additions & 0 deletions .github/workflows/docs-quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
name: Docs Quality
on:
pull_request:
workflow_dispatch:
jobs:
typos:
name: Spelling (typos-cli)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- uses: crate-ci/typos@master

harper:
name: Grammar and Style Check
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Cache Harper CLI
id: cache-harper
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/harper-cli
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-harper-cli
restore-keys: |
${{ runner.os }}-harper-cli
- name: Report cache status
run: |
echo "cache-hit output: '${{ steps.cache-harper.outputs.cache-hit }}'"
ls -la ~/.cargo/bin/ 2>&1 || echo "~/.cargo/bin does not exist"
if [ -x ~/.cargo/bin/harper-cli ]; then
echo "RESULT: harper-cli binary present and executable"
~/.cargo/bin/harper-cli --version || true
else
echo "RESULT: harper-cli binary NOT present -- full reinstall will run"
fi
- name: Install Harper CLI
if: steps.cache-harper.outputs.cache-hit != 'true'
run: cargo install --locked --git https://github.com/Automattic/harper.git harper-cli
- name: Lint docs with Harper
run: |
set -uo pipefail
ONLY_RULES=(
UseTitleCase
RepeatedWords
MergeWords
ItsContraction
)
ONLY_ARG="--only $(IFS=,; echo "${ONLY_RULES[*]}")"
mdxtmp="$(mktemp -d)"
out="$(mktemp)"
total=0
bad=0
while IFS= read -r -d '' file; do
total=$((total+1))
case "$file" in
*.mdx)
target="$mdxtmp/${file}.md"
mkdir -p "$(dirname "$target")"
cp "$file" "$target"
;;
*)
target="$file"
;;
esac
echo "::group::$file"
if harper-cli lint $ONLY_ARG "$target" 2>&1 | tee -a "$out"; then
:
else
bad=$((bad+1))
fi
echo "::endgroup::"
done < <(
find docs src/pages \
-type f \( -name "*.md" -o -name "*.mdx" \) \
-print0 2>/dev/null
)
titlecase=$(grep -c 'Capitalization::UseTitleCase' "$out" || true)
{
echo "### Harper summary"
echo "- Files scanned: $total"
echo "- Files with issues: $bad"
echo "- Heading title case violations: $titlecase"
echo ""
echo "### Violations by rule"
echo '```'
grep -oE '\[[A-Za-z]+::[A-Za-z]+\]' "$out" | sort | uniq -c | sort -rn || true
echo '```'
} >> "$GITHUB_STEP_SUMMARY"
echo "== Harper: $bad/$total files with issues; $titlecase UseTitleCase violations =="
[ "$bad" -eq 0 ]
- name: Annotate PR with Harper warnings
if: always()
run: |
set -uo pipefail
ONLY_RULES=(
UseTitleCase
RepeatedWords
MergeWords
ItsContraction
)
ONLY_ARG="--only $(IFS=,; echo "${ONLY_RULES[*]}")"
mdxtmp="$(mktemp -d)"
while IFS= read -r -d '' file; do
case "$file" in
*.mdx)
target="$mdxtmp/${file}.md"
mkdir -p "$(dirname "$target")"
cp "$file" "$target"
;;
*)
target="$file"
;;
esac
if json_out="$(harper-cli lint $ONLY_ARG --format json "$target" 2>/dev/null)"; then
:
else
printf '%s' "$json_out" | FILE="$file" python3 -c "import json,sys,os;d=json.load(sys.stdin);fp=os.environ['FILE'];esc=lambda s: s.replace('%','%25').replace('\r','%0D').replace('\n','%0A');[print('::warning file='+esc(fp)+',line='+str(l.get('line',1))+',col='+str(l.get('column',1))+',title='+esc(l.get('rule','?'))+'::'+esc(l.get('message',''))) for f in d for l in f.get('lints',[])]" || true
fi
done < <(
find docs src/pages \
-type f \( -name "*.md" -o -name "*.mdx" \) \
-print0 2>/dev/null
)
3 changes: 3 additions & 0 deletions _typos.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[files]
extend-exclude = ["*", "!*/", "!*.md", "!*.mdx"]

[default.extend-words]
# Scientific Software
namd = "namd"
Expand Down
2 changes: 2 additions & 0 deletions docs/hpc/harpertestfile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## test file
## `rsync` And `rclone`
Loading