Skip to content

Commit f398822

Browse files
committed
Added nolintername
1 parent 77933e4 commit f398822

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

handler_test.go

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,35 @@ func TestLangHandler_lint_Integration(t *testing.T) {
5252
},
5353
},
5454
},
55+
{
56+
name: "nolintername",
57+
h: &langHandler{
58+
logger: newStdLogger(false),
59+
command: []string{"golangci-lint", "run", "--out-format", "json", "--issues-exit-code=1"},
60+
rootDir: filepath.Dir("./testdata/nolintername"),
61+
noLinterName: true,
62+
},
63+
filePath: "./testdata/nolintername/main.go",
64+
want: []Diagnostic{
65+
{
66+
Range: Range{
67+
Start: Position{
68+
Line: 2,
69+
Character: 4,
70+
},
71+
End: Position{
72+
Line: 2,
73+
Character: 4,
74+
},
75+
},
76+
Severity: DSWarning,
77+
Code: nil,
78+
Source: pt("unused"),
79+
Message: "var `foo` is unused",
80+
RelatedInformation: nil,
81+
},
82+
},
83+
},
5584
}
5685

5786
for _, tt := range tests {

testdata/nolintername/main.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
package main
2+
3+
var foo = "foo"

0 commit comments

Comments
 (0)