Fix after #890: don't propagate linter errors for golangci.com

This commit is contained in:
Denis Isaev 2020-01-19 16:19:23 +03:00
parent 1ac15487b2
commit 40d7bcd53e
No known key found for this signature in database
GPG Key ID: A36A0EC8E27A1A01

View File

@ -3,6 +3,7 @@ package lint
import (
"context"
"fmt"
"os"
"runtime/debug"
"strings"
@ -187,7 +188,10 @@ func (r Runner) Run(ctx context.Context, linters []*linter.Config, lintCtx *lint
linterIssues, err := r.runLinterSafe(ctx, lintCtx, lc)
if err != nil {
r.Log.Warnf("Can't run linter %s: %s", lc.Linter.Name(), err)
if os.Getenv("GOLANGCI_COM_RUN") == "" {
// Don't stop all linters on one linter failure for golangci.com.
runErr = err
}
return
}
issues = append(issues, linterIssues...)