@@ -17,6 +17,8 @@ func TestLangHandler_lint_Integration(t *testing.T) {
17
17
t .Fatal ("golangci-lint is not installed in this environment" )
18
18
}
19
19
20
+ command := []string {"golangci-lint" , "run" , "--output.json.path" , "stdout" , "--issues-exit-code=1" , "--show-stats=false" }
21
+
20
22
tests := []struct {
21
23
name string
22
24
h * langHandler
@@ -27,7 +29,7 @@ func TestLangHandler_lint_Integration(t *testing.T) {
27
29
name : "no config file" ,
28
30
h : & langHandler {
29
31
logger : newStdLogger (false ),
30
- command : [] string { "golangci-lint" , "run" , "--out-format" , "json" , "--issues-exit-code=1" } ,
32
+ command : command ,
31
33
rootDir : filepath .Dir ("./testdata/noconfig" ),
32
34
},
33
35
filePath : "./testdata/noconfig/main.go" ,
@@ -46,7 +48,7 @@ func TestLangHandler_lint_Integration(t *testing.T) {
46
48
Severity : DSWarning ,
47
49
Code : nil ,
48
50
Source : pt ("unused" ),
49
- Message : "unused: var ` foo` is unused" ,
51
+ Message : "unused: var foo is unused" ,
50
52
RelatedInformation : nil ,
51
53
},
52
54
},
@@ -55,7 +57,7 @@ func TestLangHandler_lint_Integration(t *testing.T) {
55
57
name : "nolintername option works as expected" ,
56
58
h : & langHandler {
57
59
logger : newStdLogger (false ),
58
- command : [] string { "golangci-lint" , "run" , "--out-format" , "json" , "--issues-exit-code=1" } ,
60
+ command : command ,
59
61
rootDir : filepath .Dir ("./testdata/nolintername" ),
60
62
noLinterName : true ,
61
63
},
@@ -75,7 +77,7 @@ func TestLangHandler_lint_Integration(t *testing.T) {
75
77
Severity : DSWarning ,
76
78
Code : nil ,
77
79
Source : pt ("unused" ),
78
- Message : "var ` foo` is unused" ,
80
+ Message : "var foo is unused" ,
79
81
RelatedInformation : nil ,
80
82
},
81
83
},
@@ -84,7 +86,7 @@ func TestLangHandler_lint_Integration(t *testing.T) {
84
86
name : "config file is loaded successfully" ,
85
87
h : & langHandler {
86
88
logger : newStdLogger (false ),
87
- command : [] string { "golangci-lint" , "run" , "--out-format" , "json" , "--issues-exit-code=1" } ,
89
+ command : command ,
88
90
rootDir : filepath .Dir ("./testdata/nolintername" ),
89
91
},
90
92
filePath : "./testdata/loadconfig/main.go" ,
@@ -112,7 +114,7 @@ func TestLangHandler_lint_Integration(t *testing.T) {
112
114
name : "multiple files in rootDir" ,
113
115
h : & langHandler {
114
116
logger : newStdLogger (false ),
115
- command : [] string { "golangci-lint" , "run" , "--out-format" , "json" , "--issues-exit-code=1" } ,
117
+ command : command ,
116
118
rootDir : filepath .Dir ("./testdata/multifile" ),
117
119
},
118
120
filePath : "./testdata/multifile/bar.go" ,
@@ -131,7 +133,7 @@ func TestLangHandler_lint_Integration(t *testing.T) {
131
133
Severity : DSWarning ,
132
134
Code : nil ,
133
135
Source : pt ("unused" ),
134
- Message : "unused: var ` bar` is unused" ,
136
+ Message : "unused: var bar is unused" ,
135
137
RelatedInformation : nil ,
136
138
},
137
139
},
@@ -140,7 +142,7 @@ func TestLangHandler_lint_Integration(t *testing.T) {
140
142
name : "nested directories in rootDir" ,
141
143
h : & langHandler {
142
144
logger : newStdLogger (false ),
143
- command : [] string { "golangci-lint" , "run" , "--out-format" , "json" , "--issues-exit-code=1" } ,
145
+ command : command ,
144
146
rootDir : filepath .Dir ("./testdata/nesteddir" ),
145
147
},
146
148
filePath : "./testdata/nesteddir/bar/bar.go" ,
@@ -159,7 +161,7 @@ func TestLangHandler_lint_Integration(t *testing.T) {
159
161
Severity : DSWarning ,
160
162
Code : nil ,
161
163
Source : pt ("unused" ),
162
- Message : "unused: var ` bar` is unused" ,
164
+ Message : "unused: var bar is unused" ,
163
165
RelatedInformation : nil ,
164
166
},
165
167
},
0 commit comments