Grigory Zubankov 6b60cb8a30
new nlreturn linter (#1267)
* new nlreturn linter

* fix: import order

Co-authored-by: Sergey Vilgelm <sergey.vilgelm@ibm.com>
2020-08-02 15:16:45 -05:00

20 lines
463 B
Go

package golinters
import (
"github.com/ssgreg/nlreturn/v2/pkg/nlreturn"
"golang.org/x/tools/go/analysis"
"github.com/golangci/golangci-lint/pkg/golinters/goanalysis"
)
func NewNLReturn() *goanalysis.Linter {
return goanalysis.NewLinter(
"nlreturn",
"nlreturn checks for a new line before return and branch statements to increase code clarity",
[]*analysis.Analyzer{
nlreturn.NewAnalyzer(),
},
nil,
).WithLoadMode(goanalysis.LoadModeSyntax)
}