mirror of
https://github.com/scratchfoundation/golangci-lint.git
synced 2025-08-06 19:39:19 -04:00
rework skip dir algorithm
This commit is contained in:
parent
441bdb33d1
commit
7dfb9cff3d
4 changed files with 60 additions and 56 deletions
test
|
@ -56,15 +56,21 @@ func TestUnsafeOk(t *testing.T) {
|
|||
testshared.NewLintRunner(t).Run("--enable-all", getTestDataDir("unsafe")).ExpectNoIssues()
|
||||
}
|
||||
|
||||
func TestSkippedDirs(t *testing.T) {
|
||||
r := testshared.NewLintRunner(t).Run("--print-issued-lines=false", "--no-config", "--skip-dirs", "skip_me", "-Egolint",
|
||||
getTestDataDir("skipdirs", "..."))
|
||||
func TestSkippedDirsNoMatchArg(t *testing.T) {
|
||||
dir := getTestDataDir("skipdirs", "skip_me", "nested")
|
||||
r := testshared.NewLintRunner(t).Run("--print-issued-lines=false", "--no-config", "--skip-dirs", dir, "-Egolint", dir)
|
||||
|
||||
r.ExpectExitCode(exitcodes.IssuesFound).
|
||||
ExpectOutputEq("testdata/skipdirs/examples_no_skip/with_issue.go:8:9: if block ends with " +
|
||||
ExpectOutputEq("testdata/skipdirs/skip_me/nested/with_issue.go:8:9: if block ends with " +
|
||||
"a return statement, so drop this else and outdent its block (golint)\n")
|
||||
}
|
||||
|
||||
func TestSkippedDirsTestdata(t *testing.T) {
|
||||
r := testshared.NewLintRunner(t).Run("--print-issued-lines=false", "--no-config", "-Egolint", getTestDataDir("skipdirs", "..."))
|
||||
|
||||
r.ExpectNoIssues() // all was skipped because in testdata
|
||||
}
|
||||
|
||||
func TestDeadcodeNoFalsePositivesInMainPkg(t *testing.T) {
|
||||
testshared.NewLintRunner(t).Run("--no-config", "--disable-all", "-Edeadcode", getTestDataDir("deadcode_main_pkg")).ExpectNoIssues()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue