Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/engine/data_matcher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions internal/inline/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ 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
// DisableAnnotations hides the little move badges.
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
}
2 changes: 1 addition & 1 deletion internal/inline/render_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
8 changes: 4 additions & 4 deletions internal/inline/slicer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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:])
Expand Down Expand Up @@ -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()
}

Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion internal/pipeline/pipeline_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
})
Expand Down
4 changes: 2 additions & 2 deletions internal/postprocess/normalize_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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("{", "{")
Expand Down Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading