Skip to content

Commit

Permalink
fix: allow lint-govulncheck to be disabled
Browse files Browse the repository at this point in the history
See golang/go#64112

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
  • Loading branch information
smira committed Nov 30, 2023
1 parent 902f3bd commit c42e995
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion internal/project/golang/govulncheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ import (
)

// GoVulnCheck provides GoVulnCheck linter.
type GoVulnCheck struct {
type GoVulnCheck struct { //nolint:govet
dag.BaseNode

Disabled bool `yaml:"disabled"`

meta *meta.Options
projectPath string
}
Expand All @@ -34,6 +36,12 @@ func NewGoVulnCheck(meta *meta.Options, projectPath string) *GoVulnCheck {

// CompileMakefile implements makefile.Compiler.
func (lint *GoVulnCheck) CompileMakefile(output *makefile.Output) error {
if lint.Disabled {
output.Target(lint.Name()).Description("Disabled govulncheck linter.")

return nil
}

output.Target(lint.Name()).Description("Runs govulncheck linter.").
Script("@$(MAKE) target-$@")

Expand All @@ -42,6 +50,10 @@ func (lint *GoVulnCheck) CompileMakefile(output *makefile.Output) error {

// CompileDockerfile implements dockerfile.Compiler.
func (lint *GoVulnCheck) CompileDockerfile(output *dockerfile.Output) error {
if lint.Disabled {
return nil
}

output.Stage(lint.Name()).
Description("runs govulncheck").
From("base").
Expand Down

0 comments on commit c42e995

Please sign in to comment.