Skip to content

Commit

Permalink
add CheckersCollection and register checkers through it
Browse files Browse the repository at this point in the history
Signed-off-by: Iskander Sharipov <[email protected]>
  • Loading branch information
quasilyte committed Nov 15, 2018
1 parent aab431f commit 9165c41
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions contrib.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Package checkers is a gocritic linter auxiliary checks submited by contributors.
package contrib

import (
"github.com/go-lintpack/lintpack"
)

var collection = &lintpack.CheckerCollection{
URL: "https://github.com/go-critic/checkers-contrib",
}
2 changes: 1 addition & 1 deletion importPackageName_checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func init() {
info.Before = `import lint "github.com/go-critic/go-critic/lint"`
info.After = `import "github.com/go-critic/go-critic/lint"`

lintpack.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker {
collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker {
return &importPackageNameChecker{ctx: ctx}
})
}
Expand Down

0 comments on commit 9165c41

Please sign in to comment.