Skip to content

Commit

Permalink
add workflows in testdata/err to test for Linter.LintFiles
Browse files Browse the repository at this point in the history
  • Loading branch information
rhysd committed Mar 2, 2024
1 parent b75f226 commit 0b6ca07
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions linter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,22 +199,31 @@ func TestLinterLintError(t *testing.T) {
}
}

func TestLinterLintAllExamples(t *testing.T) {
func TestLinterLintAllErrorWorkflowsAtOnce(t *testing.T) {
shellcheck, err := execabs.LookPath("shellcheck")
if err != nil {
t.Skipf("shellcheck is not found: %s", err)
}

pyflakes, err := execabs.LookPath("pyflakes")
if err != nil {
t.Skipf("pyflakes is not found: %s", err)
}

dir, files, err := testFindAllWorkflowsInDir("examples")
if err != nil {
panic(err)
}

// Root directory must be testdata/examples/ since some workflow assumes it
proj := &Project{root: dir}

shellcheck, err := execabs.LookPath("shellcheck")
_, fs, err := testFindAllWorkflowsInDir("err")
if err != nil {
t.Skipf("shellcheck is not found: %s", err)
panic(err)
}

pyflakes, err := execabs.LookPath("pyflakes")
if err != nil {
t.Skipf("pyflakes is not found: %s", err)
for _, f := range fs {

Check failure on line 225 in linter_test.go

View workflow job for this annotation

GitHub Actions / Lint

should replace loop with files = append(files, fs...) (S1011)
files = append(files, f)
}

o := LinterOptions{
Expand Down

0 comments on commit 0b6ca07

Please sign in to comment.