build: require go 1.25 (chroma v2.27) and align release workflow
This commit is contained in:
@@ -0,0 +1,78 @@
|
||||
# Task 1 & 2 Implementation Report — Multi-Line Comment Support (chroma)
|
||||
|
||||
## Files created
|
||||
|
||||
- `internal/processor/engine.go` — `Options`, `LineChange`, `resolveLexer`, `shouldDrop`, `isCommentType`, `leadingWhitespace` (Task 1), then `StripComments`, `legacyStrip`, `changed` (Task 2).
|
||||
- `internal/processor/engine_test.go` — `TestResolveLexer`, `TestShouldDrop` (Task 1), then `TestStripComments` (Task 2).
|
||||
|
||||
## Files modified
|
||||
|
||||
- `go.mod` — added `github.com/alecthomas/chroma/v2 v2.27.0` as a direct dependency (also pulled in `github.com/dlclark/regexp2/v2` as indirect). `go get` + `go mod tidy` bumped the `go` directive from `1.24.4` to `1.25` (local toolchain is go1.26.4; this was an automatic side effect of dependency resolution, not a manual edit).
|
||||
- `go.sum` — updated accordingly.
|
||||
|
||||
No other files were touched. No code comments (`//`, `#`, block, or doc) were added anywhere; the only `//` sequences in the diff are inside Go string literals in test fixture data (e.g. `"z(); // a /* b\nw();\n"`), not actual comments.
|
||||
|
||||
## Task 1 verification
|
||||
|
||||
- Red: `go test ./internal/processor -run 'TestResolveLexer|TestShouldDrop'` failed with `undefined: resolveLexer` / `undefined: Options` / `undefined: shouldDrop` before `engine.go` existed.
|
||||
- Green: same command passed after `engine.go` was created.
|
||||
|
||||
## Task 2 verification
|
||||
|
||||
Red: `go test ./internal/processor -run TestStripComments` failed with `undefined: StripComments` before `StripComments`/`legacyStrip`/`changed` were added.
|
||||
|
||||
Green — `go test ./internal/processor -run TestStripComments -v`:
|
||||
|
||||
```
|
||||
=== RUN TestStripComments
|
||||
=== RUN TestStripComments/multiline_block_collapses
|
||||
=== RUN TestStripComments/inline_block_both_sides_kept
|
||||
=== RUN TestStripComments/preproc_kept_comment_dropped
|
||||
=== RUN TestStripComments/unterminated_block_to_eof
|
||||
=== RUN TestStripComments/marker_inside_line_comment_inert
|
||||
=== RUN TestStripComments/raw_string_preserved
|
||||
=== RUN TestStripComments/string_marker_preserved
|
||||
=== RUN TestStripComments/preserve_pattern_keeps_line
|
||||
=== RUN TestStripComments/preserve-lines_blanks_comment-only
|
||||
=== RUN TestStripComments/inline_flag_keeps_block
|
||||
=== RUN TestStripComments/block_flag_keeps_line
|
||||
=== RUN TestStripComments/straddle_block_kept
|
||||
=== RUN TestStripComments/range_block_removed_when_fully_inside
|
||||
--- PASS: TestStripComments (0.03s)
|
||||
--- PASS: TestStripComments/multiline_block_collapses (0.00s)
|
||||
--- PASS: TestStripComments/inline_block_both_sides_kept (0.00s)
|
||||
--- PASS: TestStripComments/preproc_kept_comment_dropped (0.00s)
|
||||
--- PASS: TestStripComments/unterminated_block_to_eof (0.00s)
|
||||
--- PASS: TestStripComments/marker_inside_line_comment_inert (0.00s)
|
||||
--- PASS: TestStripComments/raw_string_preserved (0.00s)
|
||||
--- PASS: TestStripComments/string_marker_preserved (0.00s)
|
||||
--- PASS: TestStripComments/preserve_pattern_keeps_line (0.00s)
|
||||
--- PASS: TestStripComments/preserve-lines_blanks_comment-only (0.01s)
|
||||
--- PASS: TestStripComments/inline_flag_keeps_block (0.00s)
|
||||
--- PASS: TestStripComments/block_flag_keeps_line (0.00s)
|
||||
--- PASS: TestStripComments/straddle_block_kept (0.00s)
|
||||
--- PASS: TestStripComments/range_block_removed_when_fully_inside (0.00s)
|
||||
PASS
|
||||
ok github.com/carlosarraes/shush/internal/processor 0.038s
|
||||
```
|
||||
|
||||
All 13 subtests passed on the first implementation attempt — no engine-code fixes were needed against the plan's expected values.
|
||||
|
||||
## `make check` result
|
||||
|
||||
Run after both Task 1 and Task 2 (gate before each commit). Both runs exited `0` (fmt + vet + test all clean), including the pre-existing `TestWholeFile` single-line golden suite (all 17 subtests green) and the full existing `cmd/shush`, `internal/git`, `internal/processor` suites.
|
||||
|
||||
```
|
||||
exit=0
|
||||
...
|
||||
ok github.com/carlosarraes/shush/cmd/shush ...
|
||||
ok github.com/carlosarraes/shush/internal/git ...
|
||||
ok github.com/carlosarraes/shush/internal/processor ...
|
||||
```
|
||||
|
||||
## jj commits
|
||||
|
||||
1. `81a729b169b6` — `feat(processor): add chroma dep, lexer resolution and drop rules`
|
||||
2. `8fac929fd266` — `feat(processor): StripComments chroma engine with legacy fallback`
|
||||
|
||||
Working copy now at an empty change `e678a5935f74` on top of commit 2, ready for Task 3.
|
||||
Reference in New Issue
Block a user