Skip to content

Commit 475e8b2

Browse files
committed
fix: address code-review findings on lineclass_scan test PR
- Remove stale IncomingAnchorEdges audit entry (exemption already present at internal/lsp/rename.go:437) - Add internal/rules/listscan to the approved-helpers list in the architecture hub and audit checklist, restoring the clearance that was deleted when the 2026-06-21 audit entry was compressed - Add TestContainsFold directly testing the sliding-window case-insensitive searcher (boundary cases: match at pos 0, middle, last window; no match; needle longer than line; empty line) - Add end-of-input success case to TestScanTagName Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VwsEmnkHJvLoaj8imqQRjJ
1 parent 20df7df commit 475e8b2

4 files changed

Lines changed: 19 additions & 8 deletions

File tree

docs/development/architecture-audit.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -286,9 +286,5 @@ PR #690 are in range.
286286
- `internal/lint/layer0_html.go` — 7
287287
unexported helpers. PR #701 in-flight.
288288

289-
- `internal/lsp/rename.go`
290-
`IncomingAnchorEdges` lacks a test or
291-
"// no test by design" exemption.
292-
293289
[2606260614]: ../../plan/2606260614_arch-fix-lineclass-scan-helper-tests.md
294290
[2606260615]: ../../plan/2606260615_arch-fix-cuelite-engine-helper-tests.md

docs/development/architecture/audit-checklist.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,8 @@ explicit mention here:
211211
- **A rule package importing another
212212
rule package** — always a DIP
213213
blocker. Helpers belong in
214-
`internal/mdtext` or
215-
`internal/rules/astutil`.
214+
`internal/mdtext`, `internal/rules/astutil`,
215+
or `internal/rules/listscan`.
216216
- **`cmd/mdsmith/main.go` past ~1000
217217
lines** — handler bodies have crept
218218
in; relocate to `internal/engine` or

docs/development/architecture/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,8 @@ caught and the reasons we reject them:
275275
attracts unrelated code.
276276
- **A rule package importing another rule
277277
package.** Rules share helpers via
278-
`internal/mdtext` or
279-
`internal/rules/astutil`; reaching
278+
`internal/mdtext`, `internal/rules/astutil`,
279+
or `internal/rules/listscan`; reaching
280280
sideways into a sibling rule binds
281281
release cycles that should stay
282282
independent.

internal/lint/lineclass_scan_test.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,16 @@ func TestHTMLType6AndClose(t *testing.T) {
190190
assert.False(t, containsType1Close([]byte("short")), "shorter than any closer")
191191
}
192192

193+
func TestContainsFold(t *testing.T) {
194+
needle := []byte("</pre>")
195+
assert.True(t, containsFold([]byte("</PRE>"), needle), "match at position 0")
196+
assert.True(t, containsFold([]byte("x</Pre>y"), needle), "match in middle")
197+
assert.True(t, containsFold([]byte("x</PRE>"), needle), "match at last window")
198+
assert.False(t, containsFold([]byte("x</em>y"), needle), "no match")
199+
assert.False(t, containsFold([]byte("</pr"), needle), "needle longer than line")
200+
assert.False(t, containsFold([]byte(""), needle), "empty line")
201+
}
202+
193203
func TestContainerMarkerScanners(t *testing.T) {
194204
assert.Equal(t, 2, blockquoteMarker([]byte("> x")))
195205
assert.Equal(t, 1, blockquoteMarker([]byte(">x")), "marker with no following space")
@@ -378,6 +388,11 @@ func TestScanTagName(t *testing.T) {
378388
// Empty input.
379389
_, ok = scanTagName([]byte(""), 0)
380390
assert.False(t, ok)
391+
392+
// Name runs to end of input (no terminator byte).
393+
i, ok = scanTagName([]byte("img"), 0)
394+
assert.True(t, ok)
395+
assert.Equal(t, 3, i)
381396
}
382397

383398
// TestScanAttribute pins the attribute scanner.

0 commit comments

Comments
 (0)