Skip to content

Commit a7ba9f5

Browse files
committed
fix: related to new rules.
1 parent db8cc66 commit a7ba9f5

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

test/linters_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,8 @@ func extractRunContextFromComments(t *testing.T, sourcePath string) *runContext
215215
if !strings.HasPrefix(line, "//") {
216216
return rc
217217
}
218-
line = strings.TrimPrefix(line, "//")
218+
219+
line = strings.TrimLeft(strings.TrimPrefix(line, "//"), " ")
219220
if strings.HasPrefix(line, "args: ") {
220221
assert.Nil(t, rc.args)
221222
args := strings.TrimPrefix(line, "args: ")

test/testdata/fix/out/gofumpt.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
//args: -Egofumpt
2-
//config: linters-settings.gofumpt.extra-rules=true
1+
// args: -Egofumpt
2+
// config: linters-settings.gofumpt.extra-rules=true
33
package testdata
44

55
import "fmt"

test/testdata/gofumpt.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//args: -Egofumpt
1+
// args: -Egofumpt
22
package testdata
33

44
import "fmt"

test/testdata/gofumpt_with_extra.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
//args: -Egofumpt
2-
//config: linters-settings.gofumpt.extra-rules=true
1+
// args: -Egofumpt
2+
// config: linters-settings.gofumpt.extra-rules=true
33
package testdata
44

55
import "fmt"

0 commit comments

Comments
 (0)