Skip to content

Commit

Permalink
Merge pull request #1696 from jonjohnsonjr/lint
Browse files Browse the repository at this point in the history
Handle WalkDir errors
  • Loading branch information
jonjohnsonjr authored Dec 12, 2024
2 parents 8db01eb + e713bf5 commit 2426a39
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pkg/linter/linter.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ func allPaths(fn func(ctx context.Context, pkgname, path string) error) func(ctx
if err := ctx.Err(); err != nil {
return err
}
if err != nil {
return err
}
if d.IsDir() {
// Ignore directories
return nil
Expand Down Expand Up @@ -286,7 +289,6 @@ func worldWriteableLinter(ctx context.Context, pkgname string, fsys fs.FS) error
if err := ctx.Err(); err != nil {
return err
}

if err != nil {
return err
}
Expand Down Expand Up @@ -389,9 +391,12 @@ func strippedLinter(ctx context.Context, _ string, fsys fs.FS) error {
})
}

func emptyLinter(_ context.Context, pkgname string, fsys fs.FS) error {
func emptyLinter(ctx context.Context, pkgname string, fsys fs.FS) error {
foundfile := false
err := fs.WalkDir(fsys, ".", func(path string, d fs.DirEntry, err error) error {
if err := ctx.Err(); err != nil {
return err
}
if err != nil {
return err
}
Expand Down

0 comments on commit 2426a39

Please sign in to comment.