mirror of
https://github.com/scratchfoundation/golangci-lint.git
synced 2025-08-02 01:20:52 -04:00
add exhaustive linter (#1166)
* wip more add new files run command fixes more * go.mod * order * same package * review comment * enable linter in .golangci.yml * add testcase for default-signifies-exhaustive: true * adjust runGoErrchk instead * disable the linter * cleanup * more cleanup * cleanup
This commit is contained in:
parent
71b2f04e88
commit
f3376cab71
12 changed files with 102 additions and 6 deletions
test
|
@ -17,9 +17,13 @@ import (
|
|||
|
||||
func runGoErrchk(c *exec.Cmd, files []string, t *testing.T) {
|
||||
output, err := c.CombinedOutput()
|
||||
assert.Error(t, err)
|
||||
_, ok := err.(*exec.ExitError)
|
||||
assert.True(t, ok, err)
|
||||
// The returned error will be nil if the test file does not have any issues
|
||||
// and thus the linter exits with exit code 0. So perform the additional
|
||||
// assertions only if the error is non-nil.
|
||||
if err != nil {
|
||||
_, ok := err.(*exec.ExitError)
|
||||
assert.True(t, ok, err)
|
||||
}
|
||||
|
||||
// TODO: uncomment after deprecating go1.11
|
||||
// assert.Equal(t, exitcodes.IssuesFound, exitErr.ExitCode())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue