Skip to content

Commit 3dbd5af

Browse files
committed
Add html-validate check, fix privacy policy HTML
- Added `html-validate` as a website check (runs on built HTML after `website-build`) - Configured `.htmlvalidate.json` to focus on structural validity, disabling noisy rules from framework-generated code - Fixed `privacy-policy.astro`: unclosed `<ul>`, `<li>` nested inside `<li>`, and sections 3–12 incorrectly nested inside the first list - Updated AGENTS.md and check runner CLAUDE.md
1 parent 0ad03f4 commit 3dbd5af

8 files changed

Lines changed: 308 additions & 186 deletions

File tree

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Run the smallest set of checks possible for efficiency while maintaining confide
5353
|cargo-audit|cargo-deny|cargo-udeps|jscpd-rust|cfg-gate|rust-tests|rust-tests-linux (slow)|license-server-prettier
5454
|license-server-eslint|license-server-typecheck|license-server-tests|gofmt|go-vet|staticcheck|ineffassign|misspell
5555
|gocyclo|nilaway|deadcode|go-tests|website-prettier|website-eslint|website-typecheck|website-build
56-
|website-e2e|docker-build|pnpm-audit|file-length}` (can use multiple `--check` flags or even a comma-separated list)
56+
|website-e2e|html-validate|docker-build|pnpm-audit|file-length}` (can use multiple `--check` flags or even a comma-separated list)
5757
- Run all: `./scripts/check.sh`. Runs all tests, linters, and formatters (with auto fixing) for all apps.
5858
- **E2E testing**: Docker E2E, Playwright smoke tests, VNC debugging, fixture system — see the colocated
5959
CLAUDE.md files in `apps/desktop/test/e2e-linux/` and `apps/desktop/test/e2e-macos/`

apps/website/.htmlvalidate.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"extends": ["html-validate:recommended"],
3+
"rules": {
4+
"no-inline-style": "off",
5+
"hidden-focusable": "off",
6+
"unique-landmark": "off",
7+
"prefer-native-element": "off",
8+
"no-trailing-whitespace": "off",
9+
"tel-non-breaking": "off",
10+
"no-raw-characters": "off"
11+
}
12+
}

apps/website/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"eslint-plugin-astro": "^1.6.0",
4040
"eslint-plugin-prettier": "^5.5.5",
4141
"globals": "^17.4.0",
42+
"html-validate": "^10.11.1",
4243
"prettier": "^3.8.1",
4344
"prettier-plugin-astro": "^0.14.1",
4445
"typescript": "^5.9.3",

apps/website/src/pages/privacy-policy.astro

Lines changed: 184 additions & 184 deletions
Large diffs are not rendered by default.

pnpm-lock.yaml

Lines changed: 74 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/check/CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ tests, type checkers before tests.
158158
|-----|------|--------|
159159
| Desktop | Rust | rustfmt, clippy, cargo-audit, cargo-deny, cargo-udeps, jscpd, tests, tests-linux (slow) |
160160
| Desktop | Svelte | prettier, eslint, stylelint, css-unused, svelte-check, knip, type-drift, tests, smoke, e2e-linux-typecheck, e2e-linux (slow) |
161-
| Website | Astro | prettier, eslint, typecheck, build, e2e |
161+
| Website | Astro | prettier, eslint, typecheck, build, html-validate, e2e |
162162
| Website | Docker | docker-build |
163163
| License server | TS | prettier, eslint, typecheck, tests |
164164
| Scripts | Go | gofmt, go-vet, staticcheck, ineffassign, misspell, gocyclo, nilaway, deadcode, go-tests |

scripts/check/checks/registry.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,15 @@ var AllChecks = []CheckDefinition{
231231
DependsOn: []string{"website-typecheck"},
232232
Run: RunWebsiteBuild,
233233
},
234+
{
235+
ID: "website-html-validate",
236+
Nickname: "html-validate",
237+
DisplayName: "html-validate",
238+
App: AppWebsite,
239+
Tech: "🚀 Astro",
240+
DependsOn: []string{"website-build"},
241+
Run: RunWebsiteHTMLValidate,
242+
},
234243
{
235244
ID: "website-e2e",
236245
DisplayName: "e2e",
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package checks
2+
3+
import (
4+
"fmt"
5+
"os"
6+
"os/exec"
7+
"path/filepath"
8+
)
9+
10+
// RunWebsiteHTMLValidate runs html-validate on the built website HTML files.
11+
func RunWebsiteHTMLValidate(ctx *CheckContext) (CheckResult, error) {
12+
websiteDir := filepath.Join(ctx.RootDir, "apps", "website")
13+
distDir := filepath.Join(websiteDir, "dist")
14+
15+
if _, err := os.Stat(distDir); os.IsNotExist(err) {
16+
return Skipped("dist/ not found (run website-build first)"), nil
17+
}
18+
19+
cmd := exec.Command("pnpm", "exec", "html-validate", "dist/**/*.html")
20+
cmd.Dir = websiteDir
21+
output, err := RunCommand(cmd, true)
22+
if err != nil {
23+
return CheckResult{}, fmt.Errorf("HTML validation failed\n%s", indentOutput(output))
24+
}
25+
return Success("All HTML files valid"), nil
26+
}

0 commit comments

Comments
 (0)