File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 8
8
megacheckAPI "github.com/golangci/go-tools/cmd/megacheck"
9
9
"github.com/golangci/golangci-lint/pkg/lint/linter"
10
10
"github.com/golangci/golangci-lint/pkg/result"
11
+ "github.com/sirupsen/logrus"
11
12
)
12
13
13
14
type Megacheck struct {
@@ -51,6 +52,17 @@ func (m Megacheck) Desc() string {
51
52
}
52
53
53
54
func (m Megacheck ) Run (ctx context.Context , lintCtx * linter.Context ) ([]result.Issue , error ) {
55
+ if len (lintCtx .NotCompilingPackages ) != 0 {
56
+ var packages []string
57
+ for _ , p := range lintCtx .NotCompilingPackages {
58
+ packages = append (packages , p .String ())
59
+ }
60
+ logrus .Warnf ("Can't run megacheck because of compilation errors in packages " +
61
+ "%s: run `typecheck` linter to see errors" , packages )
62
+ // megacheck crashes if there are not compiling packages
63
+ return nil , nil
64
+ }
65
+
54
66
issues := megacheckAPI .Run (lintCtx .Program , lintCtx .LoaderConfig , lintCtx .SSAProgram ,
55
67
m .StaticcheckEnabled , m .GosimpleEnabled , m .UnusedEnabled )
56
68
if len (issues ) == 0 {
You can’t perform that action at this time.
0 commit comments