Skip to content

Commit 0b6c32c

Browse files
committed
Rename a variable
1 parent f589a0a commit 0b6c32c

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

hooks/jsonnet-fmt-hook/main.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ func summarizeDiff(diffs []diffmatchpatch.Diff) *FileDiff {
9797
case diffmatchpatch.DiffEqual:
9898
var showHead, showTail bool
9999
lastLineBreak = text[len(text)-1:] == "\n"
100-
partLines := min(maxShowLine, len(lines))
100+
writeLineCount := min(maxShowLine, len(lines))
101101

102102
if i == 0 {
103103
showTail = true
@@ -108,18 +108,18 @@ func summarizeDiff(diffs []diffmatchpatch.Diff) *FileDiff {
108108
showHead = true
109109
}
110110

111-
if showHead && showTail && len(lines) <= partLines*2 {
111+
if showHead && showTail && len(lines) <= writeLineCount*2 {
112112
writeString(&builder, text)
113113
continue
114114
}
115115

116-
if (showHead || showTail) && len(lines) <= partLines {
116+
if (showHead || showTail) && len(lines) <= writeLineCount {
117117
writeString(&builder, text)
118118
continue
119119
}
120120

121121
if showHead {
122-
partText := strings.Join(lines[:partLines], "\n")
122+
partText := strings.Join(lines[:writeLineCount], "\n")
123123
writeString(&builder, partText)
124124
if partText[len(partText)-1:] != "\n" {
125125
writeString(&builder, "\n")
@@ -130,7 +130,7 @@ func summarizeDiff(diffs []diffmatchpatch.Diff) *FileDiff {
130130
if !showHead && !lastLineBreak {
131131
writeString(&builder, omissionText)
132132
}
133-
writeString(&builder, strings.Join(lines[len(lines)-partLines:], "\n"))
133+
writeString(&builder, strings.Join(lines[len(lines)-writeLineCount:], "\n"))
134134
}
135135
}
136136
}

0 commit comments

Comments
 (0)