Skip to content
Closed
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
bfe6ebd
Add Harper workflow for grammar and style checks
Amanda-dong Jun 30, 2026
0d20fcf
Remove Rust installation step from workflow
Amanda-dong Jun 30, 2026
5b966a7
Update Harper CLI installation method in workflow
Amanda-dong Jun 30, 2026
56c9370
Update Harper CLI lint command to use find
Amanda-dong Jun 30, 2026
1613f33
Add new terms to the harper dictionary
Amanda-dong Jul 1, 2026
cb8179b
Update .harper-dictionary.txt
Amanda-dong Jul 2, 2026
5b7af72
Update harper.yml
Amanda-dong Jul 2, 2026
4118ded
Update harper.yml
Amanda-dong Jul 2, 2026
e7c5300
Update harper.yml
Amanda-dong Jul 2, 2026
ebb69ab
Change report generation from spelling to compact
Amanda-dong Jul 2, 2026
181ec99
Update harper.yml
Amanda-dong Jul 2, 2026
8d39bb5
make harper not fail
Amanda-dong Jul 3, 2026
1d83d13
Update harper.yml
Amanda-dong Jul 3, 2026
e823000
Update .harper-dictionary.txt
Amanda-dong Jul 3, 2026
0ab4847
Modify Harper workflow to check selected rules
Amanda-dong Jul 3, 2026
03a4156
Update harper.yml
Amanda-dong Jul 3, 2026
b30a67d
Update harper.yml
Amanda-dong Jul 3, 2026
25a3a24
Update .harper-dictionary.txt
Amanda-dong Jul 3, 2026
5de2f13
Update .harper-dictionary.txt
Amanda-dong Jul 3, 2026
d429fe7
Update harper.yml
Amanda-dong Jul 3, 2026
258b0b3
Refactor Harper CI workflow and linting logic
Amanda-dong Jul 3, 2026
f9d0e3c
Enhance Harper rule check with ignore conditions
Amanda-dong Jul 6, 2026
b967a45
Update .harper-dictionary.txt
Amanda-dong Jul 6, 2026
2774f7a
Add 'analyses' to the dictionary
Amanda-dong Jul 6, 2026
c59ce34
turn to capspell for spelling detection
Amanda-dong Jul 7, 2026
65fe211
Refactor GitHub Actions workflow for documentation quality
Amanda-dong Jul 7, 2026
6db8c1e
Add script to check and fix Markdown heading case
Amanda-dong Jul 7, 2026
d7fe40d
Update harper.yml
Amanda-dong Jul 7, 2026
978660e
Create cspell.json
Amanda-dong Jul 7, 2026
f1b0723
Update and rename harper.yml to docs-quality.yml
Amanda-dong Jul 7, 2026
eec944d
Update docs-quality.yml
Amanda-dong Jul 7, 2026
5c7e58d
Update check_heading_case.py
Amanda-dong Jul 7, 2026
a065e5f
Rename workflow and update steps for docs quality
Amanda-dong Jul 7, 2026
899201a
Update cspell.json
Amanda-dong Jul 7, 2026
676b28f
Update cspell.json
Amanda-dong Jul 7, 2026
b9610c7
Update docs-quality.yml
Amanda-dong Jul 7, 2026
f6e4a1c
Delete check_heading_case.py
Amanda-dong Jul 8, 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
102 changes: 67 additions & 35 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
@@ -1,49 +1,81 @@
name: Code Quality

permissions:
contents: read
name: Docs Quality

on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
inputs:
allow_failure:
type: boolean
default: false

env:
ALLOW_FAILURE: ${{ github.event_name == 'workflow_dispatch' && inputs.allow_failure }}

jobs:
code-quality:
name: Code Quality
spelling:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v7

- name: Setup Node.js
uses: actions/setup-node@v6
- uses: actions/checkout@v6
- uses: actions/setup-node@v4
with:
node-version: latest

- name: Install pnpm
uses: pnpm/action-setup@v6
node-version: "20"
- uses: actions/cache@v4
with:
version: latest
path: ~/.npm
key: ${{ runner.os }}-npm-cspell
restore-keys: ${{ runner.os }}-npm-cspell-
- run: |
npx --yes -p cspell@9 -p @cspell/cspell-json-reporter cspell lint \
"docs/**/*.{md,mdx}" \
"src/pages/**/*.{md,mdx}" \
--config cspell.json \
--no-progress \
--reporter "@cspell/cspell-json-reporter" \
> cspell-report.json || true
- run: |
python - <<'PY'
import json
import os
import sys

- name: Setup pnpm config
run: |
pnpm config set store-dir ~/.pnpm-store
try:
with open("cspell-report.json", encoding="utf-8") as f:
content = f.read().strip()
except FileNotFoundError:
content = ""

- uses: actions/cache@v6
name: Setup pnpm cache
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
if not content:
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).")
sys.exit(1)

try:
data = json.loads(content)
except json.JSONDecodeError:
print("::error::cspell-report.json is not valid JSON. Raw output was:")
print(content[:2000])
sys.exit(1)

issues = data.get("issues", [])
for issue in issues:
file = issue.get("uri")
line = issue.get("row")
message = issue.get("message") or f"Unknown word: {issue.get('text')!r}"
print(f"::error file={file},line={line}::{message}")

- name: Install dependencies
run: pnpm install
print(f"{len(issues)} spelling issue(s) found.")

- name: Check Prettier formatting
run: pnpm format --check
allow_failure = os.environ.get("ALLOW_FAILURE") == "true"
sys.exit(1 if issues and not allow_failure else 0)
PY

- name: Run ESLint and Stylelint
run: pnpm lint
heading-case:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- run: |
python check_heading_case.py docs src/pages || {
if [ "$ALLOW_FAILURE" = "true" ]; then
exit 0
fi
exit 1
}
85 changes: 85 additions & 0 deletions .github/workflows/docs-quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Docs Quality

on:
pull_request:
workflow_dispatch:
inputs:
allow_failure:
type: boolean
default: false

env:
ALLOW_FAILURE: ${{ github.event_name == 'workflow_dispatch' && inputs.allow_failure }}

jobs:
spelling:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v4
with:
node-version: "20"
- uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-npm-cspell
restore-keys: ${{ runner.os }}-npm-cspell-
- run: |
npx --yes -p cspell@9 -p @cspell/cspell-json-reporter cspell lint \
"docs/**/*.{md,mdx}" \
"src/pages/**/*.{md,mdx}" \
--config cspell.json \
--no-progress \
--reporter "@cspell/cspell-json-reporter" \
> cspell-report.json || true
- run: |
python - <<'PY'
import json
import os
import sys

try:
with open("cspell-report.json", encoding="utf-8") as f:
content = f.read().strip()
except FileNotFoundError:
content = ""

if not content:
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).")
sys.exit(1)

try:
data = json.loads(content)
except json.JSONDecodeError:
print("::error::cspell-report.json is not valid JSON. Raw output was:")
print(content[:2000])
sys.exit(1)

issues = data.get("issues", [])
for issue in issues:
uri = issue.get("uri", "")
file = uri.replace("file://", "")
if "/rts-docs/" in file:
file = file.split("/rts-docs/", 1)[-1]
line = issue.get("row")
message = issue.get("message") or f"Unknown word: {issue.get('text')!r}"
print(f"{file}:{line}: {message}")
print(f"::error file={file},line={line}::{message}")

print(f"{len(issues)} spelling issue(s) found.")

allow_failure = os.environ.get("ALLOW_FAILURE") == "true"
sys.exit(1 if issues and not allow_failure else 0)
PY

heading-case:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- run: |
python check_heading_case.py docs src/pages || {
if [ "$ALLOW_FAILURE" = "true" ]; then
exit 0
fi
exit 1
}
1 change: 0 additions & 1 deletion .harper-dictionary.txt

This file was deleted.

20 changes: 20 additions & 0 deletions cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"version": "0.2",
"language": "en",
"dictionaries": ["project-words", "bash", "npm", "node", "softwareTerms"],
"dictionaryDefinitions": [
{
"name": "project-words",
"path": "./project-words.txt",
"addWords": true
}
],
"ignoreRegExpList": [
"https?:\\/\\/\\S+",
"[a-fA-F0-9]{8,}",
"\\b[A-Za-z0-9_-]{16,}\\b"
],
"ignorePaths": [
"**/node_modules/**"
]
}
Loading
Loading