Skip to content

Commit 55a18ae

Browse files
committed
don't make typecheck issues without file/line info
1 parent 7278b7a commit 55a18ae

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

Diff for: pkg/commands/run.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ func (e *Executor) setupExitCode(ctx context.Context) {
395395
}
396396

397397
if e.exitCode == exitcodes.Success &&
398-
os.Getenv("GL_TEST_RUN") == "1" &&
398+
(os.Getenv("GL_TEST_RUN") == "1" || os.Getenv("FAIL_ON_WARNINGS") == "1") &&
399399
len(e.reportData.Warnings) != 0 {
400400

401401
e.exitCode = exitcodes.WarningInTest

Diff for: pkg/golinters/typecheck.go

+2-5
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,8 @@ func (lint TypeCheck) Run(ctx context.Context, lintCtx *linter.Context) ([]resul
6363
errors := libpackages.ExtractErrors(pkg)
6464
for _, err := range errors {
6565
i, perr := lint.parseError(err)
66-
if perr != nil {
67-
res = append(res, result.Issue{
68-
Text: err.Msg,
69-
FromLinter: lint.Name(),
70-
})
66+
if perr != nil { // failed to parse
67+
lintCtx.Log.Errorf("typechecking error: %s", err.Msg)
7168
} else {
7269
res = append(res, *i)
7370
}

0 commit comments

Comments
 (0)