sayboras bd2921655a Added go-mnd linter (#842)
* Initial commit

* Fixed goimports

* Update pkg/golinters/mnd.go

Co-Authored-By: Bot from GolangCI <42910462+golangcibot@users.noreply.github.com>

* Run goimports

* Update pkg/golinters/mnd.go

Co-Authored-By: Bot from GolangCI <42910462+golangcibot@users.noreply.github.com>

* Add prefix for goimport local

* Run make README.md

* Incorporate review comments
Add test cases

* Update readme

* Update the description

* Removed subpath in local-prefixes

* Update readme
2019-11-15 19:08:43 -05:00

22 lines
426 B
Go

package golinters
import (
magic_numbers "github.com/tommy-muehle/go-mnd"
"golang.org/x/tools/go/analysis"
"github.com/golangci/golangci-lint/pkg/golinters/goanalysis"
)
func NewGomnd() *goanalysis.Linter {
analyzers := []*analysis.Analyzer{
magic_numbers.Analyzer,
}
return goanalysis.NewLinter(
"gomnd",
"checks whether magic number is used",
analyzers,
nil,
).WithLoadMode(goanalysis.LoadModeSyntax)
}