Skip to content

Commit

Permalink
Don't error if a path has no files to lint.
Browse files Browse the repository at this point in the history
  • Loading branch information
alecthomas committed Jul 12, 2017
1 parent 8301f08 commit 98ecff0
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 21 deletions.
3 changes: 0 additions & 3 deletions execute.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,6 @@ func (l *linterState) Partitions() ([][]string, error) {
if err != nil {
return nil, err
}
if len(parts) == 0 {
return nil, fmt.Errorf("%s: no files to lint", l.Name)
}
return parts, nil
}

Expand Down
18 changes: 0 additions & 18 deletions execute_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"sort"
"testing"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

Expand All @@ -28,20 +27,3 @@ func TestSortedIssues(t *testing.T) {
}
require.Equal(t, expected, actual)
}

func TestLinterStatePartitions(t *testing.T) {
noPartitions := func(_ []string, _ []string) ([][]string, error) {
return nil, nil
}

state := &linterState{
Linter: &Linter{
Name: "thelinter",
partitionStrategy: noPartitions,
Command: "go",
},
}

_, err := state.Partitions()
assert.EqualError(t, err, "thelinter: no files to lint")
}

0 comments on commit 98ecff0

Please sign in to comment.