Skip to content

Commit 7352ac4

Browse files
committed
tests: isolate severity files
1 parent ee40bdb commit 7352ac4

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

pkg/result/processors/severity_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ func TestSeverity_multiple(t *testing.T) {
8787
{Path: "e_test.go", Text: "testonly", Linter: "testlinter"},
8888
{Path: "e.go", Text: "nontestonly", Linter: "testlinter"},
8989
{Path: "e_test.go", Text: "nontestonly", Linter: "testlinter"},
90-
{Path: filepath.Join("testdata", "exclude_rules.go"), Line: 3, Linter: "lll"},
91-
{Path: filepath.Join("testdata", "severity_rules.go"), Line: 3, Linter: "invalidgo"},
90+
{Path: filepath.FromSlash("testdata/severity/exclude_rules.go"), Line: 3, Linter: "lll"},
91+
{Path: filepath.FromSlash("testdata/severity/severity_rules.go"), Line: 3, Linter: "invalidgo"},
9292
{Path: "someotherlinter.go", Text: "someotherlinter", Linter: "someotherlinter"},
9393
{Path: "somenotmatchlinter.go", Text: "somenotmatchlinter", Linter: "somenotmatchlinter"},
9494
{Path: "empty.go", Text: "empty", Linter: "empty"},
@@ -118,8 +118,8 @@ func TestSeverity_multiple(t *testing.T) {
118118
{Path: "e_test.go", Text: "testonly", Linter: "testlinter", Severity: "info"},
119119
{Path: "e.go", Text: "nontestonly", Linter: "testlinter", Severity: "info"}, // matched
120120
{Path: "e_test.go", Text: "nontestonly", Linter: "testlinter", Severity: "error"}, // not matched
121-
{Path: filepath.Join("testdata", "exclude_rules.go"), Line: 3, Linter: "lll", Severity: "error"},
122-
{Path: filepath.Join("testdata", "severity_rules.go"), Line: 3, Linter: "invalidgo", Severity: "info"},
121+
{Path: filepath.FromSlash("testdata/severity/exclude_rules.go"), Line: 3, Linter: "lll", Severity: "error"},
122+
{Path: filepath.FromSlash("testdata/severity/severity_rules.go"), Line: 3, Linter: "invalidgo", Severity: "info"},
123123
{Path: "someotherlinter.go", Text: "someotherlinter", Linter: "someotherlinter", Severity: "info"},
124124
{Path: "somenotmatchlinter.go", Text: "somenotmatchlinter", Linter: "somenotmatchlinter", Severity: "error"},
125125
{Path: "empty.go", Text: "empty", Linter: "empty", Severity: "error"},
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package severity
2+
3+
//go:generate --long line --with a --lot of --arguments --that we --would like --to exclude --from lll --issues --by exclude-rules
4+
5+
// long line that we don't want to exclude from lll issues. Use the similar pattern: go:generate. This line should be reported by lll
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
package testdata
1+
package severity
22

33
//go:dosomething

0 commit comments

Comments
 (0)