ci(content): run the content-style check automatically on copy changes #137
Inga granskare
Etiketter
Inga etiketter
area/backups
area/ci
area/control-panel
area/identity
area/infra
area/observability
area/payments
area/security
area/storage
area/web
blocked
needs-info
needs-triage
ready-for-implementation
type
bug
type
chore
type
docs
type
epic
type
feature
type
task
wontfix
Ingen milstolpe
Inget projekt
Inga tilldelade
1 deltagare
Notiser
Förfallodatum
Inget förfallodatum satt.
Beroenden
Inga beroenden satta
Referens
bitborg/bitborg-web!137
Läser in…
Hänvisa till i nytt ärende
Ingen beskrivning angiven.
Ta bort grenen "ci/content-style-gate"
Borttagning av en gren är permanent. Även om den borttagna grenen kan fortsätta existera en kort tid innan den faktiskt tas bort, kan det INTE ångras i de flesta fall. Vill du fortsätta?
Closes #128.
The issue argued that the obvious fix — tests asserting on copy — is the wrong one, and asked for an
automated language gate instead. This is that gate.
What it is
scripts/check-content-style.mjs(pnpm lang-check) encodes the rules fromdocs/content-style.md— brand casing, English/Swedish terminology, Forgejo term consistency, British spelling, spelled-out
shorthands — and reports the rule id and the guide section alongside each finding:
Wired into both places, not one
src/content/**/*.mdandsrc/i18n/*.ts, so a copy change ischecked as it is written.
added later would never be applied to copy that already exists.
Written in Node rather than shell so it behaves identically on macOS and in
node:24-bookworm, and sothe rule table is testable — it has 20 tests of its own.
Two changes that make it a gate rather than noise
The first run produced three false positives, which would have failed CI on day one:
arkivis the correct Swedish word for an archive on a line about backups and encryption, so it isexempt there instead of being flagged as a stand-in for kodförråd.
.tsdictionaries are not checked. Failing a commit over a code comment'swording only teaches people to write awkward comments.
lang-check-ignore-next-line <rule-id>— because a gate without one is atrap. A test caught a real bug here: the directive line matched its own rule id.
What it cannot do
Stated in the script header and in the guide: it is a regex heuristic. It stops the known faults
recurring. It cannot see a call to action that contradicts its own link, an instruction that excludes
half its audience, or tone. Reading the email and legal copy in both languages is still necessary, and
the guide says so rather than implying the gate replaces it.
Verified
pnpm lang-check→✓ content style: no candidates in 70 file(s).·pnpm test→ 169 passed ·pnpm format:checkclean ·pnpm mdlint0 issues. The gate was proven to fail end-to-end against adeliberate fault probe (exit 1, six findings) and then pass once removed, and the new pre-commit job
ran live while committing.
Follow-up, not in this PR
The private
web-language-checkskill script now duplicates this rule set and lacks the tworefinements above. It should delegate to
pnpm lang-checkso there is one source of rules.2679c3eb03f9f7e6f789