chore: add no-emdash/endash rule to agent instructions and CI lint (#24375)

Add a lint check that prevents introduction of Unicode emdash (U+2014)
and endash (U+2013) characters. These are almost exclusively introduced
by AI agents and conflict with the project writing style.

The lint script (scripts/check_emdash.sh) checks only added lines in
the current diff by default, so existing violations do not block CI.
Pass --all to scan the entire repo for auditing.

Agent instructions in AGENTS.md, site/AGENTS.md, and the docs style
guide now explicitly ban emdash, endash, and " -- " as punctuation,
with guidance to use commas, semicolons, or periods instead.
This commit is contained in:
Mathias Fredriksson
2026-04-21 13:55:24 +03:00
committed by GitHub
parent 9d0469fc4c
commit 623e72d72d
5 changed files with 146 additions and 3 deletions
+16
View File
@@ -286,6 +286,22 @@ ctx, cancel := context.WithTimeout(ctx, 5*time.Minute)
ctx, cancel := context.WithTimeout(ctx, 5*time.Minute)
```
### No Emdash or Endash
Do not use emdash (U+2014), endash (U+2013), or ` -- ` as punctuation
in code, comments, string literals, or documentation. Use commas,
semicolons, or periods instead. Restructure the sentence if needed.
Do not replace an emdash with ` -- `. Unicode emdash and endash are
caught by `make lint/emdash`.
```go
// Good: uses a period to separate the clauses.
// This is slow. We should cache it.
// Good: uses a comma to join related clauses.
// This is slow, so we should cache it.
```
### Avoid Unnecessary Changes
When fixing a bug or adding a feature, don't modify code unrelated to your