Skip to content

Commit 0de8002

Browse files
committed
Added nested dir
1 parent 4fc9cad commit 0de8002

File tree

3 files changed

+36
-0
lines changed

3 files changed

+36
-0
lines changed

handler_test.go

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,34 @@ func TestLangHandler_lint_Integration(t *testing.T) {
136136
},
137137
},
138138
},
139+
{
140+
name: "nested directories in rootDir",
141+
h: &langHandler{
142+
logger: newStdLogger(false),
143+
command: []string{"golangci-lint", "run", "--out-format", "json", "--issues-exit-code=1"},
144+
rootDir: filepath.Dir("./testdata/nesteddir"),
145+
},
146+
filePath: "./testdata/nesteddir/bar/bar.go",
147+
want: []Diagnostic{
148+
{
149+
Range: Range{
150+
Start: Position{
151+
Line: 3,
152+
Character: 4,
153+
},
154+
End: Position{
155+
Line: 3,
156+
Character: 4,
157+
},
158+
},
159+
Severity: DSWarning,
160+
Code: nil,
161+
Source: pt("unused"),
162+
Message: "unused: var `bar` is unused",
163+
RelatedInformation: nil,
164+
},
165+
},
166+
},
139167
}
140168

141169
for _, tt := range tests {

testdata/nesteddir/bar/bar.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package bar
2+
3+
// unused: var `bar` is unused
4+
var bar = "bar"

testdata/nesteddir/main.go

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

0 commit comments

Comments
 (0)