Skip to content

Commit

Permalink
Moved back to NewAnalyzer().
Browse files Browse the repository at this point in the history
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
  • Loading branch information
bwplotka committed Mar 7, 2020
1 parent 5dbd63e commit 1112ee0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ go get github.com/fatih/faillint
`faillint` works on a file, directory or a Go package:

```sh
$ faillint -paths "errors,fmt.{Errof}" foo.go # pass a file
$ faillint -paths "errors,fmt.{Errof}" ./... # recursively analyze all files
$ faillint -paths "errors,fmt.{Errof}" github.com/fatih/gomodifytags # or pass a package
$ faillint -paths "errors,fmt.{Errorf}" foo.go # pass a file
$ faillint -paths "errors,fmt.{Errorf}" ./... # recursively analyze all files
$ faillint -paths "errors,fmt.{Errorf}" github.com/fatih/gomodifytags # or pass a package
```

By default, `faillint` will not check any import paths. You need to explicitly
Expand Down
6 changes: 3 additions & 3 deletions faillint/faillint.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ type faillint struct {

// Analyzer is a global instance of the linter.
// DEPRECATED: Use faillint.New instead.
var Analyzer = New()
var Analyzer = NewAnalyzer()

// New create a faillint analyzer.
func New() *analysis.Analyzer {
// NewAnalyzer create a faillint analyzer.
func NewAnalyzer() *analysis.Analyzer {
f := faillint{
paths: "",
ignoretests: false,
Expand Down
2 changes: 1 addition & 1 deletion faillint/faillint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ func TestRun(t *testing.T) {
},
} {
t.Run(tcase.name, func(t *testing.T) {
f := New()
f := NewAnalyzer()
f.Flags.Set("paths", tcase.paths)
if tcase.ignoreTestFiles {
f.Flags.Set("ignore-tests", "true")
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ import (
)

func main() {
singlechecker.Main(faillint.New())
singlechecker.Main(faillint.NewAnalyzer())
}

0 comments on commit 1112ee0

Please sign in to comment.