diff --git a/pkg/commands/run.go b/pkg/commands/run.go index 0a6aabc6..46bfa29e 100644 --- a/pkg/commands/run.go +++ b/pkg/commands/run.go @@ -395,7 +395,7 @@ func (e *Executor) setupExitCode(ctx context.Context) { } if e.exitCode == exitcodes.Success && - os.Getenv("GL_TEST_RUN") == "1" && + (os.Getenv("GL_TEST_RUN") == "1" || os.Getenv("FAIL_ON_WARNINGS") == "1") && len(e.reportData.Warnings) != 0 { e.exitCode = exitcodes.WarningInTest diff --git a/pkg/golinters/typecheck.go b/pkg/golinters/typecheck.go index 2e567cb6..400c8e11 100644 --- a/pkg/golinters/typecheck.go +++ b/pkg/golinters/typecheck.go @@ -63,11 +63,8 @@ func (lint TypeCheck) Run(ctx context.Context, lintCtx *linter.Context) ([]resul errors := libpackages.ExtractErrors(pkg) for _, err := range errors { i, perr := lint.parseError(err) - if perr != nil { - res = append(res, result.Issue{ - Text: err.Msg, - FromLinter: lint.Name(), - }) + if perr != nil { // failed to parse + lintCtx.Log.Errorf("typechecking error: %s", err.Msg) } else { res = append(res, *i) }