
Also do following improvements: - show proper sublinter name for megacheck sublinters - refactor and make more simple and robust megacheck merging/optimizing - improve handling of unknown linter names in //nolint directives - minimize diff of our megacheck version from the upstream, https://github.com/golang/go/issues/29612 blocks usage of the upstream version - support the new `stylecheck` linter - improve tests coverage for megacheck and nolint related cases - update and use upstream versions of unparam and interfacer instead of forked ones - don't use golangci/tools repo anymore - fix newly found issues after updating linters Also should be noted that megacheck works much faster and consumes less memory in the newest release, therefore golangci-lint works noticeably faster and consumes less memory for large repos. Relates: #314
30 lines
788 B
Go
30 lines
788 B
Go
package linter
|
|
|
|
import (
|
|
"golang.org/x/tools/go/loader"
|
|
"golang.org/x/tools/go/packages"
|
|
"golang.org/x/tools/go/ssa"
|
|
|
|
"github.com/golangci/golangci-lint/pkg/config"
|
|
"github.com/golangci/golangci-lint/pkg/lint/astcache"
|
|
"github.com/golangci/golangci-lint/pkg/logutils"
|
|
)
|
|
|
|
type Context struct {
|
|
Packages []*packages.Package
|
|
NotCompilingPackages []*packages.Package
|
|
|
|
LoaderConfig *loader.Config // deprecated, don't use for new linters
|
|
Program *loader.Program // deprecated, use Packages for new linters
|
|
|
|
SSAProgram *ssa.Program // for unparam and interfacer but not for megacheck (it change it)
|
|
|
|
Cfg *config.Config
|
|
ASTCache *astcache.Cache
|
|
Log logutils.Log
|
|
}
|
|
|
|
func (c *Context) Settings() *config.LintersSettings {
|
|
return &c.Cfg.LintersSettings
|
|
}
|