Skip to content

Commit

Permalink
Added nolintername
Browse files Browse the repository at this point in the history
  • Loading branch information
nametake committed Jan 13, 2025
1 parent 77933e4 commit f398822
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
29 changes: 29 additions & 0 deletions handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,35 @@ func TestLangHandler_lint_Integration(t *testing.T) {
},
},
},
{
name: "nolintername",
h: &langHandler{
logger: newStdLogger(false),
command: []string{"golangci-lint", "run", "--out-format", "json", "--issues-exit-code=1"},
rootDir: filepath.Dir("./testdata/nolintername"),
noLinterName: true,
},
filePath: "./testdata/nolintername/main.go",
want: []Diagnostic{
{
Range: Range{
Start: Position{
Line: 2,
Character: 4,
},
End: Position{
Line: 2,
Character: 4,
},
},
Severity: DSWarning,
Code: nil,
Source: pt("unused"),
Message: "var `foo` is unused",
RelatedInformation: nil,
},
},
},
}

for _, tt := range tests {
Expand Down
3 changes: 3 additions & 0 deletions testdata/nolintername/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package main

var foo = "foo"

0 comments on commit f398822

Please # to comment.