From cf1ccd417fdf10e6a1f376439f4d75d7a10acb30 Mon Sep 17 00:00:00 2001 From: Elizabeth Myers Date: Wed, 20 Sep 2023 13:16:27 -0700 Subject: [PATCH] Remove no provides check per @kaniini Signed-off-by: Elizabeth Myers --- pkg/build/linter.go | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/pkg/build/linter.go b/pkg/build/linter.go index 2ceca5558..21c467884 100644 --- a/pkg/build/linter.go +++ b/pkg/build/linter.go @@ -28,21 +28,6 @@ type LinterContext struct { chk *config.Checks } -func (lctx LinterContext) getPackageOptions() (*config.PackageOption, error) { - if lctx.pkgname == lctx.cfg.Package.Name { - return &lctx.cfg.Package.Options, nil - } - - for _, spkg := range lctx.cfg.Subpackages { - if lctx.pkgname == spkg.Name { - return &spkg.Options, nil - } - } - - // Shouldn't get here - return nil, fmt.Errorf("Could not locate package or subpackage!") -} - type linterFunc func(lctx LinterContext, path string, d fs.DirEntry) error type linter struct { @@ -69,7 +54,7 @@ var linterMap = map[string]linter{ } var postLinterMap = map[string]postLinter{ - "empty": postLinter{emptyPostLinter, "Verify that this package is supposed to be empty, if so set the no-provides package option; otherwise, check the build"}, + "empty": postLinter{emptyPostLinter, "Verify that this package is supposed to be empty; if it is, disable this linter; otherwise check the build"}, } var isDevRegex = regexp.MustCompile("^dev/") @@ -167,7 +152,7 @@ func worldWriteableLinter(_ LinterContext, path string, d fs.DirEntry) error { return nil } -func emptyPostLinter(lctx LinterContext, fsys fs.FS) error { +func emptyPostLinter(_ LinterContext, fsys fs.FS) error { foundfile := false walkCb := func(path string, _ fs.DirEntry, err error) error { if err != nil { @@ -193,16 +178,6 @@ func emptyPostLinter(lctx LinterContext, fsys fs.FS) error { return nil } - options, err := lctx.getPackageOptions() - if err != nil { - return err - } - - if options.NoProvides { - // Nothing to do - return nil - } - return fmt.Errorf("Package is empty but no-provides is not set") }