From acfd742b02e43498ce2a7e90d0f686eaa159b1ed Mon Sep 17 00:00:00 2001 From: "kiloconnect[bot]" <240665456+kiloconnect[bot]@users.noreply.github.com> Date: Tue, 28 Apr 2026 07:56:48 +0000 Subject: [PATCH] fix: enforce exact separator form in md-table-padding check Previously the check trimmed each separator cell before comparing against the allow-list, which meant `| --- | --- |` passed as `---`. The documented rule requires the tight `|---|---|` form; compare the raw cell so space-padded separators fail too. --- script/check-md-table-padding.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/script/check-md-table-padding.ts b/script/check-md-table-padding.ts index 71856edb71..a9db08bfcb 100755 --- a/script/check-md-table-padding.ts +++ b/script/check-md-table-padding.ts @@ -112,13 +112,15 @@ function check(file: string): Issue[] { if (isSep(line)) { const cells = split(line.trim()) for (const cell of cells) { - const t = cell.trim() - if (!ok.has(t)) { + // Cells must be exactly ---, :---, ---: or :---: with no surrounding + // whitespace. Anything longer (or with space padding) is column-width + // alignment and re-pads on every content change. + if (!ok.has(cell)) { issues.push({ file, line: i + 1, kind: "separator", - detail: `separator cell "${cell}" is padded or extended — use ---, :---, ---: or :---:`, + detail: `separator cell "${cell}" is padded or extended — use ---, :---, ---: or :---: with no surrounding spaces`, }) break }