docs: give the empty-table-header check a rule section and count it
The checks table row for empty-table-header pointed at no rule section, because the formatting guide's Tables section was documentation-only, and the counts below the table still said 9 checked rules. Tables now states the header-text rule with an enforcement footer citing scripts/docshtmlcheck, and the counts move to 10 checked and 45 documentation-only. The row's Tool column now names make lint/docs-html, matching the make lint/emdash row, the paragraph on which checks fail the build includes it, and the Makefile comment and echo for lint/docs-html mention table headers. Assisted-by: AI
This commit is contained in:
1 parent
b807bcbbc7
commit
2871f89bdf
3 files changed
+23
-19
No files matched your search
@@ -844,9 +844,9 @@ lint/emdash:
|
||||
# Fails when docs Markdown contains invalid inline HTML the docs site drops or
|
||||
# mangles: swallowed angle-bracket placeholders (e.g. <region>), void-element
|
||||
# end tags (</br>), capitalized or unregistered component tags (e.g. <Image>),
|
||||
# and unclosed container tags.
|
||||
# and unclosed container tags. Also fails on table header cells with no text.
|
||||
lint/docs-html:
|
||||
echo "--- check for invalid inline HTML in docs"
|
||||
echo "--- check for invalid inline HTML and empty table headers in docs"
|
||||
go run ./scripts/docshtmlcheck
|
||||
.PHONY: lint/docs-html
|
||||
|
||||
|
||||
@@ -23,24 +23,24 @@ The doctrine for adding Vale rules lives in the [Vale doctrine README](../README
|
||||
|
||||
A clean `make lint/prose` run is not evidence that a page follows this guide.
|
||||
The guide documents 80 rules.
|
||||
Automated tooling checks 9 of them, and 1 of those 9 doesn't run on published pages.
|
||||
The other 71 are yours to apply by reading, 72 on published pages, where the one-sentence-per-line rule is off.
|
||||
Automated tooling checks 10 of them, and 1 of those 10 doesn't run on published pages.
|
||||
The other 70 are yours to apply by reading, 71 on published pages, where the one-sentence-per-line rule is off.
|
||||
|
||||
Open the section that matches what you're writing and work through it.
|
||||
The linters catch a narrow band of mechanical errors; they can't tell you that a page serves 2 audiences, buries a required step in a `NOTE`, or wraps every paragraph at 80 columns.
|
||||
|
||||
### Checks that run today
|
||||
|
||||
| Check | Tool | Severity | Scope | What it catches |
|
||||
|------------------------------------|--------------------|-----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------|
|
||||
| `Coder.BrandNames` | Vale | `error` | `docs/**` except `docs/.style/style-guide/**` | `Hashicorp` casing only, not the other brands in the word-choice list |
|
||||
| `Coder.GerundHeading` | Vale | `warning` | `docs/**` except `docs/.style/style-guide/**` | Headings that lead with a gerund |
|
||||
| `Coder.SelectClick` | Vale | `warning` | `docs/**` except `docs/.style/style-guide/**` | `click` and its inflections |
|
||||
| `Coder.OneSentencePerLine` | Vale | `warning` | `docs/.style/*.md` and `docs/.style/styles/Coder/*.md` only | Sentence boundaries mid-line, on contributor docs only |
|
||||
| `Coder.UnitSpacing` | Vale | `warning` | `docs/**` except `docs/.style/style-guide/**` and `docs/admin/integrations/prometheus.md` and `docs/admin/setup/configuration-reference.md` and `docs/reference/{api,cli}/*.md` | A regular space, or no space, between a number and its unit |
|
||||
| `MD001`, `MD025`, `MD040`, `MD045` | markdownlint | `error` | All Markdown | Heading increments, single H1, fence language, missing alt text |
|
||||
| `scripts/check_emdash.sh` | `make lint/emdash` | `error` | Repository | Em-dash, en-dash, and ` -- ` as punctuation |
|
||||
| `empty-table-header` | `docshtmlcheck` | `error` | `docs/**`, including generated pages | Table header cells with no text, in Markdown and HTML tables |
|
||||
| Check | Tool | Severity | Scope | What it catches |
|
||||
|------------------------------------|-----------------------|-----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------|
|
||||
| `Coder.BrandNames` | Vale | `error` | `docs/**` except `docs/.style/style-guide/**` | `Hashicorp` casing only, not the other brands in the word-choice list |
|
||||
| `Coder.GerundHeading` | Vale | `warning` | `docs/**` except `docs/.style/style-guide/**` | Headings that lead with a gerund |
|
||||
| `Coder.SelectClick` | Vale | `warning` | `docs/**` except `docs/.style/style-guide/**` | `click` and its inflections |
|
||||
| `Coder.OneSentencePerLine` | Vale | `warning` | `docs/.style/*.md` and `docs/.style/styles/Coder/*.md` only | Sentence boundaries mid-line, on contributor docs only |
|
||||
| `Coder.UnitSpacing` | Vale | `warning` | `docs/**` except `docs/.style/style-guide/**` and `docs/admin/integrations/prometheus.md` and `docs/admin/setup/configuration-reference.md` and `docs/reference/{api,cli}/*.md` | A regular space, or no space, between a number and its unit |
|
||||
| `MD001`, `MD025`, `MD040`, `MD045` | markdownlint | `error` | All Markdown | Heading increments, single H1, fence language, missing alt text |
|
||||
| `scripts/check_emdash.sh` | `make lint/emdash` | `error` | Repository | Em-dash, en-dash, and ` -- ` as punctuation |
|
||||
| `empty-table-header` | `make lint/docs-html` | `error` | `docs/**`, including generated pages | Table header cells with no text, in Markdown and HTML tables |
|
||||
|
||||
The markdownlint row lists only the rules that map to a rule in this guide.
|
||||
markdownlint runs its full default set minus the rules `.markdownlint.jsonc` disables, so it catches more than these 4.
|
||||
@@ -48,7 +48,7 @@ markdownlint runs its full default set minus the rules `.markdownlint.jsonc` dis
|
||||
Vale runs advisory.
|
||||
`make lint/prose` passes `--no-exit`, and the CI step is advisory by design, so no Vale finding fails a build at any severity.
|
||||
Findings accumulate instead of blocking: rules that shipped against a clean corpus have since collected a backlog of warnings in `docs/`.
|
||||
The markdownlint and emdash checks do fail the build.
|
||||
The markdownlint, emdash, and docs HTML checks do fail the build.
|
||||
|
||||
### Coverage by section
|
||||
|
||||
@@ -60,9 +60,9 @@ The markdownlint and emdash checks do fail the build.
|
||||
| [Word choice](./word-choice.md) | 17 | 2 | 10 | 5 |
|
||||
| [Accessibility and inclusion](./accessibility-and-inclusion.md) | 13 | 2 | 3 | 8 |
|
||||
| [Capitalization and punctuation](./capitalization-and-punctuation.md) | 11 | 2 | 6 | 3 |
|
||||
| [Formatting](./formatting.md) | 13 | 2 | 0 | 11 |
|
||||
| [Formatting](./formatting.md) | 13 | 3 | 0 | 10 |
|
||||
| [Numbers, units, and dates](./numbers-units-and-dates.md) | 5 | 1 | 4 | 0 |
|
||||
| **Total** | 80 | 9 | 25 | 46 |
|
||||
| **Total** | 80 | 10 | 25 | 45 |
|
||||
|
||||
Every column counts rule sections, not linter rule names.
|
||||
A rule section is a heading that carries an enforcement footer, the italic line that names the section's enforcement status.
|
||||
|
||||
@@ -422,8 +422,12 @@ A table that forces columns so narrow that words split across lines reads worse
|
||||
If a table needs many columns to capture the data, reconsider whether a table is the right structure.
|
||||
A definition list or a sequence of subsections may serve the reader better.
|
||||
|
||||
*Documentation-only.
|
||||
No Vale rule.*
|
||||
Give every header cell text that names its column or row, including the top-left corner cell of a matrix.
|
||||
A screen reader announces an empty header cell as a column or row with no name, and a cell holding only ` ` or `<br>` is still empty.
|
||||
For a matrix corner, name what the row headers hold, such as `Permission`.
|
||||
|
||||
*Enforced by `scripts/docshtmlcheck` (`empty-table-header`) for header cells with no text.
|
||||
The rest of the section is documentation-only.*
|
||||
|
||||
### Links
|
||||
|
||||
|
||||
Reference in new issue
Block a user