From eea05cf47d4428226c5dd26b370910af3d34e2bc Mon Sep 17 00:00:00 2001 From: Harsh Kapse Date: Sat, 19 Sep 2026 10:47:23 +0530 Subject: [PATCH] style: replace em dashes with hyphens and colons Replace em dashes with standard hyphens and colons, that AI left on test files. --- internal/engine/data_matcher_test.go | 2 +- internal/inline/options.go | 6 +++--- internal/inline/render_test.go | 2 +- internal/inline/slicer.go | 8 ++++---- internal/pipeline/pipeline_test.go | 2 +- internal/postprocess/normalize_test.go | 4 ++-- tests/e2e/cli_test.go | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/internal/engine/data_matcher_test.go b/internal/engine/data_matcher_test.go index f47b299f..95d44a91 100644 --- a/internal/engine/data_matcher_test.go +++ b/internal/engine/data_matcher_test.go @@ -286,7 +286,7 @@ func TestMatchDataContainersHashCollisionSafety(t *testing.T) { srcRoot.Language = "json" k2 := testutil.Leaf("string", "\"new_key\"") - // v2 has a different AST structure (an object with one child) — distinct child count. + // v2 has a different AST structure (an object with one child): distinct child count. innerChild := testutil.Leaf("string", "\"inner\"") v2 := testutil.Node("object", "", innerChild) p2 := testutil.Node("pair", "", k2, v2) diff --git a/internal/inline/options.go b/internal/inline/options.go index a7a4e420..3985ae0d 100644 --- a/internal/inline/options.go +++ b/internal/inline/options.go @@ -5,7 +5,7 @@ package inline type RenderOptions struct { // Color turns ANSI colors on or off. Color bool - // ContextLines is how much context we show — defaults to 3 lines. + // ContextLines is how much context we show - defaults to 3 lines. ContextLines int // LineNumbers shows line numbers in the gutter. LineNumbers bool @@ -13,8 +13,8 @@ type RenderOptions struct { DisableAnnotations bool // Wrap turns on soft wrapping to fit the terminal. Wrap bool - // TerminalWidth is the wrap column — 0 means auto-detect or off. + // TerminalWidth is the wrap column - 0 means auto-detect or off. TerminalWidth int - // TabWidth is spaces per tab — defaults to 4. + // TabWidth is spaces per tab - defaults to 4. TabWidth int } diff --git a/internal/inline/render_test.go b/internal/inline/render_test.go index 2d4f7cba..3867ca9f 100644 --- a/internal/inline/render_test.go +++ b/internal/inline/render_test.go @@ -658,7 +658,7 @@ func TestRender_LineWrapping_ColorMode(t *testing.T) { got := Render("old.go", "new.go", src, dst, dr.Envelope, opts) lines := strings.Split(got, "\n") - // Continuation rows shouldn't have color codes in the gutter — it should be plain spaces. + // Continuation rows shouldn't have color codes in the gutter - it should be plain spaces. // With ~5 lines, numWidth is 3, so the gutter is 9 chars wide in color mode. const contGutterWidth = 9 for _, l := range lines { diff --git a/internal/inline/slicer.go b/internal/inline/slicer.go index 74479d00..42f41603 100644 --- a/internal/inline/slicer.go +++ b/internal/inline/slicer.go @@ -190,7 +190,7 @@ func sliceInlineLine( } if curDisplayCol+tabSpaces > maxTextWidth { - // Tab doesn't fit — wrap and reset the tab stop. + // Tab doesn't fit - wrap and reset the tab stop. finishChunk() tabSpaces = tabWidth } @@ -227,7 +227,7 @@ func sliceInlineLine( if curDisplayCol+tok.displayWidth > maxTextWidth { // Token doesn't fit on this row. if tok.displayWidth > targetWidth { - // Too long for any row — cut it rune by rune. + // Too long for any row - cut it rune by rune. currRuneOffset := byteOffset for currRuneOffset < byteOffset+tok.byteLen { r, rLen := utf8.DecodeRuneInString(lineText[currRuneOffset:]) @@ -261,7 +261,7 @@ func sliceInlineLine( continue } - // It fits on the next row — wrap at the word boundary. + // It fits on the next row - wrap at the word boundary. finishChunk() } @@ -300,7 +300,7 @@ func sliceInlineLine( } // Badge goes at the end of the whole line (last visual row), not the - // first — that way it doesn't steal width from the first row and end + // first - that way it doesn't steal width from the first row and end // up mid-sentence. if badgeText != "" { if len(chunks) > 0 { diff --git a/internal/pipeline/pipeline_test.go b/internal/pipeline/pipeline_test.go index 13b3376d..9fc75bc3 100644 --- a/internal/pipeline/pipeline_test.go +++ b/internal/pipeline/pipeline_test.go @@ -36,7 +36,7 @@ func TestPipeline_LineLimitFallback(t *testing.T) { t.Errorf("expected AST parsed when line limit disabled") } - // With higher limit of 20, file has fewer lines — should parse as AST. + // With higher limit of 20, file has fewer lines - should parse as AST. resHigher, err := Run(content, content, "main.go", "main.go", DiffOptions{ MaxASTFileLines: 20, }) diff --git a/internal/postprocess/normalize_test.go b/internal/postprocess/normalize_test.go index ae6e7021..f696031f 100644 --- a/internal/postprocess/normalize_test.go +++ b/internal/postprocess/normalize_test.go @@ -648,7 +648,7 @@ func TestIsTrivialJumpBody(t *testing.T) { } }) - // An error print followed by an exit is still boilerplate — the print + // An error print followed by an exit is still boilerplate - the print // shouldn't keep it from being scored as a trivial exit block. t.Run("body pairing an error print with a terminating call is trivial", func(t *testing.T) { openBrace := mkNode("{", "{") @@ -990,7 +990,7 @@ func TestNormalizeMovesByStructure(t *testing.T) { dstStmt.StartRow = 200 dstBlock.Children = []*treesitter.ASTNode{dstStmt} - // No parent mapping — cross-scope with no mapped enclosing decl. + // No parent mapping: cross-scope with no mapped enclosing decl. ms2 := engine.NewMapping() es := actions.NewEditScript() diff --git a/tests/e2e/cli_test.go b/tests/e2e/cli_test.go index b8a24313..1c3ef380 100644 --- a/tests/e2e/cli_test.go +++ b/tests/e2e/cli_test.go @@ -362,7 +362,7 @@ format: actions _ = os.WriteFile(oldPath, []byte(oldContent), 0o644) _ = os.WriteFile(newPath, []byte(newContent), 0o644) - // No CLI flags passed — should pick up format=actions and ignore_comments from config + // No CLI flags passed - should pick up format=actions and ignore_comments from config stdout, stderr, err := runDiffm(oldPath, newPath) if err != nil { t.Fatalf("diffm failed with custom config: %v\nstderr: %s", err, stderr)