Skip to content

Commit 7b33e83

Browse files
committed
style: remove redundant comments and fix comment punctuation
1 parent b2fd195 commit 7b33e83

8 files changed

Lines changed: 14 additions & 16 deletions

File tree

assert_eventually_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ func TestEventually_ChecksOnceMoreAtTimeout(t *testing.T) {
518518
t.Parallel()
519519

520520
// given: a condition that only becomes true on its second check, and an
521-
// interval far larger than the timeout so no ticker check fires; the only
521+
// interval far larger than the timeout so no ticker check fires. The only
522522
// checks are the immediate one and the deadline one
523523
calls := 0
524524
mt := &mockT{}

assert_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1292,7 +1292,7 @@ func TestOrderedComparisons_FailOnNaN(t *testing.T) {
12921292
t.Run("Between", func(t *testing.T) {
12931293
t.Parallel()
12941294

1295-
// given: a NaN value; when: asserting it lies between bounds
1295+
// given: a NaN value, when: asserting it lies between bounds
12961296
mt := &mockT{}
12971297
testastic.Between(mt, nan, 0.0, 10.0)
12981298

@@ -1341,7 +1341,7 @@ func TestNil_HandlesUnsafePointer(t *testing.T) {
13411341

13421342
var p unsafe.Pointer
13431343

1344-
// given: a nil unsafe.Pointer; when/then: Nil passes
1344+
// given: a nil unsafe.Pointer, when/then: Nil passes
13451345
mt := &mockT{}
13461346

13471347
testastic.Nil(mt, p)
@@ -1366,7 +1366,7 @@ func TestContains_TypedNilStringerDoesNotPanic(t *testing.T) {
13661366
// given: a typed-nil pointer whose String() dereferences the receiver
13671367
var s *nilDerefStringer
13681368

1369-
// when: asserting Contains on it; then: it reports a failure instead of panicking
1369+
// when: asserting Contains on it, then: it reports a failure instead of panicking
13701370
mt := &mockT{}
13711371

13721372
testastic.Contains(mt, s, "1")

binary.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ var errBuildBinaryRequiresImportPath = errors.New("BuildBinary requires importPa
2828
type Binary struct {
2929
path string
3030
workDir string
31-
tempDir string // non-empty only for BuildBinaryMain; removed by Cleanup
31+
tempDir string // non-empty only for BuildBinaryMain, removed by Cleanup
3232
}
3333

3434
// RunResult contains the captured stdout, stderr, and exit code from a CLI run.

color_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ func TestDetectColors(t *testing.T) {
107107
func TestColorize(t *testing.T) {
108108
// Save and restore the useColors function so each subtest can stub it.
109109
// TestColorize is serial (no t.Parallel), so swapping the variable is
110-
// safe parallel tests in the package only run after this one finishes.
110+
// safe, parallel tests in the package only run after this one finishes.
111111
savedUseColors := useColors
112112

113113
t.Cleanup(func() {

diff.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ func (d diffType) String() string {
2626

2727
// difference represents a single difference between expected and actual JSON.
2828
type difference struct {
29-
Path string // JSON path, e.g., "$.users[0].name"
30-
Expected any // Expected value (or matcher description)
31-
Actual any // Actual value
32-
Type diffType // Type of difference
29+
Path string // JSON path, e.g., "$.users[0].name"
30+
Expected any // Expected value (or matcher description)
31+
Actual any
32+
Type diffType
3333
}
3434

3535
func formatFileDiffInline(expected, actual []string) string {

file_parse_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ func TestParseLine(t *testing.T) {
115115
t.Run("regex matcher", func(t *testing.T) {
116116
t.Parallel()
117117

118-
// given: a line with a regex matcher (no anchors - they're added by parseLine)
118+
// given: a line with a regex matcher (no anchors, they're added by parseLine)
119119
line := "Email: {{regex `[a-z]+@example\\.com`}}"
120120

121121
// when: parsing the line

options.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,12 @@ type Option func(*config)
3131
// Shared fields apply to all assertion types. HTML-specific fields
3232
// are only used by AssertHTML and are ignored by other assertion types.
3333
type config struct {
34-
// Shared fields.
3534
IgnoreArrayOrder bool
3635
IgnoreArrayOrderPaths []string
3736
IgnoredFields []string
3837
Update bool
3938
Message string
4039

41-
// HTML-specific fields.
4240
IgnoreComments bool
4341
PreserveWhitespace bool
4442
IgnoredElements []string

process_coverage.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ var errCovdataFailed = errors.New("go tool covdata textfmt failed")
4646
//
4747
// Without CollectSubprocessCoverage, coverage data is written to per-test temp
4848
// directories and cleaned up automatically. Processes that use [WithCoverDir]
49-
// are not affected — their coverage data goes to the specified directory.
49+
// are not affected. Their coverage data goes to the specified directory.
5050
func CollectSubprocessCoverage(m *testing.M, outputPath string) int {
5151
return collectSubprocessCoverage(m.Run, outputPath)
5252
}
@@ -81,7 +81,7 @@ func collectSubprocessCoverage(run func() int, outputPath string) int {
8181

8282
// convertProcessCoverage converts binary coverage data under coverDir to a
8383
// text profile at outputPath using `go tool covdata textfmt`. coverDir may
84-
// hold coverage files directly or one subdir per subprocess run; both
84+
// hold coverage files directly or one subdir per subprocess run, both
8585
// layouts are aggregated.
8686
func convertProcessCoverage(coverDir string, outputPath string) error {
8787
inputDirs, err := collectCoverInputDirs(coverDir)
@@ -119,7 +119,7 @@ func convertProcessCoverage(coverDir string, outputPath string) error {
119119
}
120120

121121
// collectCoverInputDirs returns the input directories for `go tool covdata`.
122-
// Per-run subdirs each count as one input; a flat coverDir with files counts
122+
// Per-run subdirs each count as one input, a flat coverDir with files counts
123123
// as a single input.
124124
func collectCoverInputDirs(coverDir string) ([]string, error) {
125125
entries, err := os.ReadDir(coverDir)

0 commit comments

Comments
 (0)