Skip to content

Commit 7efec06

Browse files
authored
Merge pull request #25036 from dvdksn/vale
vale: overhaul ruleset to reduce noise and false positives
2 parents eabe758 + 8571e1b commit 7efec06

10 files changed

Lines changed: 145 additions & 56 deletions

File tree

.agents/skills/write/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Prettier runs automatically after each edit via the PostToolUse hook.
4545
Run lint manually after all edits are complete:
4646

4747
```bash
48-
${CLAUDE_SKILL_DIR}/scripts/lint.sh <changed-files>
48+
scripts/lint.sh <changed-files>
4949
```
5050

5151
The lint script runs markdownlint and vale on only the files you pass it,

.vale.ini

Lines changed: 21 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -3,45 +3,34 @@ MinAlertLevel = suggestion
33
IgnoredScopes = text.frontmatter, code, tt, b, strong, i, a
44
Vocab = Docker
55

6-
# Disable rules for genered content
7-
[content/reference/**/**.md]
8-
Vale.Spelling = NO
9-
Vale.Terms = NO
6+
# Generated reference content — disable rules that don't apply
7+
[content/reference/**]
108
Docker.Capitalization = NO
11-
12-
[content/manuals/*/release-notes/*.md]
139
Vale.Spelling = NO
1410
Vale.Terms = NO
15-
Docker.Capitalization = NO
16-
Docker.We = NO
1711

18-
[content/manuals/*/release-notes.md]
19-
Vale.Spelling = NO
20-
Vale.Terms = NO
21-
Docker.Capitalization = NO
22-
Docker.We = NO
23-
24-
[content/contribute/*.md]
25-
Vale.Spelling = NO
26-
Vale.Terms = NO
12+
# Skip release notes and old desktop changelog content entirely
13+
[{content/manuals/*/release-notes.md,content/manuals/*/release-notes/**,content/manuals/desktop/previous-versions/**}]
14+
Docker.Avoid = NO
2715
Docker.Capitalization = NO
2816
Docker.Exclamation = NO
29-
30-
[content/manuals/desktop/previous-versions/*.md]
17+
Docker.Forbidden = NO
18+
Docker.GenericCTA = NO
19+
Docker.HeadingPunctuation = NO
20+
Docker.ListComma = NO
21+
Docker.OxfordComma = NO
22+
Docker.RecommendedWords = NO
23+
Docker.Spacing = NO
24+
Docker.Terms = NO
25+
Docker.URLFormat = NO
26+
Docker.Units = NO
27+
Docker.VersionText = NO
28+
Docker.We = NO
3129
Vale.Spelling = NO
30+
Vale.Repetition = NO
3231
Vale.Terms = NO
33-
Docker.Capitalization = NO
34-
Docker.Exclamation = NO
3532

3633
[*.md]
37-
BasedOnStyles = Vale, Docker
38-
# Exclude `{{< ... >}}`, `{{% ... %}}`, [Who]({{< ... >}})
39-
TokenIgnores = ({{[%<] .* [%>]}}.*?{{[%<] ?/.* [%>]}}), \
40-
(\[.+\]\({{< .+ >}}\)), \
41-
[^\S\r\n]({{[%<] \w+ .+ [%>]}})\s, \
42-
[^\S\r\n]({{[%<](?:/\*) .* (?:\*/)[%>]}})\s, \
43-
(?sm)({{[%<] .*?\s[%>]}})
44-
45-
# Exclude `{{< myshortcode `This is some <b>HTML</b>, ... >}}`
46-
BlockIgnores = (?sm)^({{[%<] \w+ [^{]*?\s[%>]}})\n$, \
47-
(?s) *({{< highlight [^>]* ?>}}.*?{{< ?/ ?highlight >}})
34+
BasedOnStyles = Docker, Vale
35+
TokenIgnores = ({{[%<][^}]+[%>]}})
36+
BlockIgnores = (?m)^[ \t]*({{[%<][^}]+[%>]}})[ \t]*$

AGENTS.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,25 @@ introduced, which is permanently true.
8080

8181
- Use lowercase "config" in prose — `vale.Terms` flags a capital-C "Config"
8282

83+
### Updating the vocabulary
84+
85+
If Vale flags a legitimate tech term, product name, or compound identifier
86+
as a misspelling, add it to `_vale/config/vocabularies/Docker/accept.txt`.
87+
This is optional — only update when a real new term is missing, not to
88+
silence individual violations.
89+
90+
- Use the canonical form for case-sensitive product names (`PyTorch`,
91+
`GitHub`, `Kubernetes`, `BuildKit`). `Vale.Terms` enforces that exact
92+
case across the docs.
93+
- Use `[Aa]bcd` character-class regex for words that legitimately appear
94+
in multiple cases (e.g., sentence-starting capitalization, or a name
95+
that's also a generic noun). This covers spelling without enforcing
96+
a single canonical form.
97+
- Avoid broad regex patterns — entries that match many words at once
98+
(especially with `(?i)`) suppress other rule checks on every match.
99+
- Don't add a wrong-cased entry to silence one false positive — it
100+
cascades into `Vale.Terms` violations on every correct usage.
101+
83102
## Alpine.js patterns
84103

85104
Do not combine Alpine's `x-show` with the HTML `hidden` attribute on the
@@ -111,12 +130,17 @@ produces broken HTML — always check COMPONENTS.md for correct syntax.
111130

112131
```sh
113132
npx prettier --write <file> # Format before committing
133+
scripts/lint.sh <file>... # Lint specific files (markdownlint + vale)
114134
docker buildx bake validate # Run all validation checks
115135
docker buildx bake lint # Markdown linting only
116136
docker buildx bake vale # Style guide checks only
117137
docker buildx bake test # HTML and link checking
118138
```
119139

140+
For incremental work, prefer `scripts/lint.sh` over the `bake` targets —
141+
it runs the same checks on just the files you pass, so the output stays
142+
scoped to your changes instead of the whole repo.
143+
120144
### Validation in git worktrees
121145

122146
`docker buildx bake validate` fails in git worktrees because Hugo cannot
@@ -128,9 +152,14 @@ and `validate-vendor` targets run correctly in CI.
128152

129153
1. Make changes
130154
2. Format with prettier: `npx prettier --write <file>`
131-
3. Run `docker buildx bake lint vale`
155+
3. Lint the changed files: `scripts/lint.sh <file>...`
132156
4. Run a full build with `docker buildx bake` (optional for small changes)
133157

158+
Always lint the specific files you changed before committing. Use
159+
`scripts/lint.sh` rather than the `bake` targets so the output is scoped
160+
to your changes — bake runs across the entire repo and the noise makes
161+
real issues easy to miss.
162+
134163
## Git hygiene
135164

136165
- **Stage files explicitly.** Never use `git add .` / `git add -A` /

_vale/Docker/Capitalization.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ action:
77
params:
88
- Docker
99
tokens:
10-
- '[^\[/]docker[^/]'
10+
- '[^\[/\-.]docker[^/\-.\w]'

_vale/Docker/RecommendedWords.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,5 @@ swap:
3737
repo: repository
3838
scroll: navigate
3939
url: URL
40-
vs: versus
40+
'\bvs\b(?!\.|\s+Code)': versus
4141
wish: want

_vale/Docker/Units.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ message: "Use '%s' instead of '%s'"
33
link: https://docs.docker.com/contribute/style/recommended-words/
44
level: error
55
swap:
6-
(?:kilobytes?|KB): kB
6+
kilobytes?: kB
77
gigabytes?: GB
88
megabytes?: MB
99
petabytes?: PB

_vale/Docker/VersionText.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ link: https://docs.docker.com/contribute/style/recommended-words/#later
44
scope: raw
55
raw:
66
- '\bv?'
7-
- '(?P<major>0|[1-9]\d*)\.?'
8-
- '(?P<minor>0|[1-9]\d*)?\.?'
9-
- '(?P<patch>0|[1-9]\d*)?'
7+
- '(?P<major>0|[1-9]\d*)\.'
8+
- '(?P<minor>0|[1-9]\d*)'
9+
- '(?:\.(?P<patch>0|[1-9]\d*))?'
1010
- '(?:-(?P<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?'
1111
- '(?:\+(?P<buildmetadata>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?'
1212
- '\b (and|or) (higher|above)'

_vale/Docker/We.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
extends: existence
22
message: "Avoid using first-person plural like '%s'."
33
level: warning
4-
ignorecase: true
4+
ignorecase: false
55
tokens:
6-
- we
7-
- we'(?:ve|re)
8-
- ours?
6+
- '[Ww]e'
7+
- "[Ww]e'(?:ve|re)"
8+
- '[Oo]urs?'
99
- us
10-
- let's
10+
- Us
11+
- "[Ll]et's"

_vale/config/vocabularies/Docker/accept.txt

Lines changed: 78 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ dockerignore
8181
Dockerize
8282
Dockerized
8383
Dockerizing
84-
Duckduckgo
84+
DuckDuckGo
8585
Entra
8686
EPERM
8787
ESXi
@@ -92,7 +92,7 @@ Fargate
9292
Fedora
9393
firewalld
9494
Flink
95-
fluentd
95+
Fluentd
9696
g?libc
9797
GeoNetwork
9898
GGUF
@@ -145,7 +145,6 @@ logback
145145
Loggly
146146
Logstash
147147
lookup
148-
Mac
149148
macOS
150149
macvlan
151150
Mail(chimp|gun)
@@ -223,7 +222,7 @@ stdin
223222
stdout
224223
subfolder
225224
sudo
226-
subvolume
225+
[Ss]ubvolume
227226
Syft
228227
syntaxes
229228
Sysbox
@@ -243,8 +242,7 @@ Ubuntu
243242
ufw
244243
uv
245244
umask
246-
uncaptured
247-
Uncaptured
245+
[Uu]ncaptured
248246
unconfigured
249247
undeterminable
250248
Unix
@@ -253,7 +251,7 @@ unmanaged
253251
upsert
254252
Visual Studio Code
255253
VMware
256-
vpnkit
254+
VPNKit
257255
vSphere
258256
Vulkan
259257
Vue
@@ -312,7 +310,7 @@ Zsh
312310
[Pp]roxied
313311
[Pp]roxying
314312
[pP]yright
315-
[Rr]eadme
313+
README
316314
[Rr]eal-time
317315
[Rr]egex(es)?
318316
[Rr]untimes?
@@ -346,3 +344,75 @@ Zsh
346344
[Ee]vals?
347345
[Ll]abspaces?
348346
[Uu]nsloth
347+
AppArmor
348+
[Aa]utolocking
349+
[Bb]oolean
350+
[Bb]reakpoint
351+
CMD
352+
[Dd]eno
353+
[Dd]evicemapper
354+
[Dd]ockerbot
355+
[Dd]ockerd
356+
docker_ce_version
357+
[Ee]nv
358+
ESLint
359+
gzip
360+
HAProxy
361+
[Ii]nlined
362+
journald
363+
JSON
364+
keypair
365+
Kustomize
366+
latest_engine_api_version
367+
[Mm]iddleware
368+
[Nn]onroot
369+
param
370+
[Pp]erformant
371+
Pinecone
372+
Qdrant
373+
[Rr]outable
374+
[Ss]emver
375+
setuid
376+
SHA
377+
spaCy
378+
src
379+
stderr
380+
Streamlit
381+
[Ss]ubcommand
382+
syslog
383+
TCP
384+
thinpool
385+
[Tt]runked
386+
UID
387+
[Uu]nencrypted
388+
[Uu]nmount
389+
URL
390+
VM
391+
Vite
392+
Vitest
393+
Wolfi
394+
[Aa]utoextend
395+
[Bb]ackoff
396+
[Bb]crypt
397+
[Bb]undler
398+
copy_up
399+
[Dd]eclaratively
400+
[Dd]eduplication
401+
dnf
402+
docker_gwbridge
403+
[Gg]lobbing
404+
GPG
405+
KVM
406+
[Mm]ulticast
407+
[Mm]isconfigured
408+
oldstable
409+
OpenSSL
410+
[Ss]tringified
411+
SwarmKit
412+
[Uu]ncomment
413+
Buildkite
414+
Graylog
415+
Libnetwork
416+
Nodemon
417+
PHPUnit
418+
PyTorch
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#!/bin/bash
22
# Run markdownlint and vale on specific files.
3-
# Usage: .agents/skills/write/scripts/lint.sh <file> [file...]
3+
# Usage: scripts/lint.sh <file> [file...]
44
#
5-
# Designed for agent workflows — scoped output, no repo-wide noise.
6-
# For full repo validation, use: docker buildx bake validate
5+
# Scoped output — no repo-wide noise. For full repo validation, use:
6+
# docker buildx bake validate
77
set -uo pipefail
88

99
if [ $# -eq 0 ]; then

0 commit comments

Comments
 (0)