mirror of
https://github.com/scratchfoundation/golangci-lint.git
synced 2025-08-28 22:28:43 -04:00
async issues processing
This commit is contained in:
parent
c9bb265140
commit
4853151835
76 changed files with 600 additions and 3499 deletions
29
pkg/result/processors/nolint_test.go
Normal file
29
pkg/result/processors/nolint_test.go
Normal file
|
@ -0,0 +1,29 @@
|
|||
package processors
|
||||
|
||||
import (
|
||||
"go/token"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
"github.com/golangci/golangci-lint/pkg/result"
|
||||
)
|
||||
|
||||
func newNolintFileIssue(line int, fromLinter string) result.Issue {
|
||||
return result.Issue{
|
||||
File: filepath.Join("testdata", "nolint.go"),
|
||||
LineNumber: line,
|
||||
FromLinter: fromLinter,
|
||||
}
|
||||
}
|
||||
|
||||
func TestNolint(t *testing.T) {
|
||||
p := NewNolint(token.NewFileSet())
|
||||
processAssertEmpty(t, p, newNolintFileIssue(3, "gofmt"))
|
||||
processAssertEmpty(t, p, newNolintFileIssue(3, "gofmt")) // check cached is ok
|
||||
processAssertSame(t, p, newNolintFileIssue(3, "gofmtA")) // check different name
|
||||
|
||||
processAssertEmpty(t, p, newNolintFileIssue(4, "any"))
|
||||
processAssertEmpty(t, p, newNolintFileIssue(5, "any"))
|
||||
|
||||
processAssertSame(t, p, newNolintFileIssue(1, "golint"))
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue