Skip to content

Commit

Permalink
build(deps): bump github.com/go-critic/go-critic from 0.7.0 to 0.8.0 (#…
Browse files Browse the repository at this point in the history
…3810)

Co-authored-by: Oleksandr Redko <[email protected]>
Co-authored-by: Fernandez Ludovic <[email protected]>
  • Loading branch information
3 people authored Apr 30, 2023
1 parent 58182e7 commit bc616e8
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ require (
github.com/fatih/color v1.15.0
github.com/firefart/nonamedreturns v1.0.4
github.com/fzipp/gocyclo v0.6.0
github.com/go-critic/go-critic v0.7.0
github.com/go-critic/go-critic v0.8.0
github.com/go-xmlfmt/xmlfmt v1.1.2
github.com/gofrs/flock v0.8.1
github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2
Expand Down
4 changes: 2 additions & 2 deletions go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pkg/config/linters_settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@ type GoConstSettings struct {
}

type GoCriticSettings struct {
Go string `mapstructure:"-"`
EnabledChecks []string `mapstructure:"enabled-checks"`
DisabledChecks []string `mapstructure:"disabled-checks"`
EnabledTags []string `mapstructure:"enabled-tags"`
Expand Down
2 changes: 2 additions & 0 deletions pkg/golinters/gocritic.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ func (w *goCriticWrapper) run(pass *analysis.Pass) ([]goanalysis.Issue, error) {

linterCtx := gocriticlinter.NewContext(pass.Fset, w.sizes)

linterCtx.SetGoVersion(w.settingsWrapper.Go)

enabledCheckers, err := w.buildEnabledCheckers(linterCtx)
if err != nil {
return nil, err
Expand Down
4 changes: 4 additions & 0 deletions pkg/lint/lintersdb/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,10 @@ func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config {
govetCfg.Go = m.cfg.Run.Go
}

if gocriticCfg != nil {
gocriticCfg.Go = m.cfg.Run.Go
}

if gofumptCfg != nil && gofumptCfg.LangVersion == "" {
gofumptCfg.LangVersion = m.cfg.Run.Go
}
Expand Down

0 comments on commit bc616e8

Please sign in to comment.