mirror of
https://github.com/scratchfoundation/golangci-lint.git
synced 2025-08-28 22:28:43 -04:00
Fix #124: support unparam linter
1. Support unparam linter and fix found issues 2. Replace forked mvdan.cc/lint and mvdan.cc/interfacer with the upstream ones 3. Minimize forked megacheck: move the most of it's code to this repo 4. Use golang.org/x/tools/go/ssa import path instead of custom fork paths 5. In golang.org/x/tools/go/{ssa,callgraph} use changed code from honnef.co/go/tools 6. Add megacheck.check-unexported option: it found some issues in the repo, fixed them all
This commit is contained in:
parent
70193b9b4d
commit
a6b91ccc77
97 changed files with 1839 additions and 439 deletions
|
@ -21,8 +21,8 @@ func newNolintFileIssue(line int, fromLinter string) result.Issue {
|
|||
}
|
||||
}
|
||||
|
||||
func newNolint2FileIssue(line int, fromLinter string) result.Issue {
|
||||
i := newNolintFileIssue(line, fromLinter)
|
||||
func newNolint2FileIssue(line int) result.Issue {
|
||||
i := newNolintFileIssue(line, "errcheck")
|
||||
i.Pos.Filename = filepath.Join("testdata", "nolint2.go")
|
||||
return i
|
||||
}
|
||||
|
@ -85,19 +85,19 @@ func TestNolint(t *testing.T) {
|
|||
|
||||
// check bug with transitive expanding for next and next line
|
||||
for i := 1; i <= 8; i++ {
|
||||
processAssertSame(t, p, newNolint2FileIssue(i, "errcheck"))
|
||||
processAssertSame(t, p, newNolint2FileIssue(i))
|
||||
}
|
||||
for i := 9; i <= 10; i++ {
|
||||
processAssertEmpty(t, p, newNolint2FileIssue(i, "errcheck"))
|
||||
processAssertEmpty(t, p, newNolint2FileIssue(i))
|
||||
}
|
||||
|
||||
// check inline comment for function
|
||||
for i := 11; i <= 13; i++ {
|
||||
processAssertSame(t, p, newNolint2FileIssue(i, "errcheck"))
|
||||
processAssertSame(t, p, newNolint2FileIssue(i))
|
||||
}
|
||||
processAssertEmpty(t, p, newNolint2FileIssue(14, "errcheck"))
|
||||
processAssertEmpty(t, p, newNolint2FileIssue(14))
|
||||
for i := 15; i <= 18; i++ {
|
||||
processAssertSame(t, p, newNolint2FileIssue(i, "errcheck"))
|
||||
processAssertSame(t, p, newNolint2FileIssue(i))
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue