Skip to content

Commit

Permalink
build(deps): bump github.com/securego/gosec/v2 from 2.9.6 to 2.10.0 (#…
Browse files Browse the repository at this point in the history
…2624)

Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
  • Loading branch information
dependabot[bot] and ldez authored Feb 27, 2022
1 parent adc0d8e commit 6fc688a
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 12 deletions.
4 changes: 4 additions & 0 deletions .golangci.example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,10 @@ linters-settings:
# Default: low
confidence: medium

# Concurrency value.
# Default: the number of logical CPUs usable by the current process.
concurrency: 12

# To specify the configuration of rules.
# The configuration of rules is not fully documented by gosec:
# https://github.com/securego/gosec#configuration
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ require (
github.com/ryancurrah/gomodguard v1.2.3
github.com/ryanrolds/sqlclosecheck v0.3.0
github.com/sanposhiho/wastedassign/v2 v2.0.6
github.com/securego/gosec/v2 v2.9.6
github.com/securego/gosec/v2 v2.10.0
github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c
github.com/shirou/gopsutil/v3 v3.22.1
github.com/sirupsen/logrus v1.8.1
Expand Down
12 changes: 7 additions & 5 deletions go.sum

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

18 changes: 13 additions & 5 deletions pkg/config/linters_settings.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
package config

import "github.com/pkg/errors"
import (
"runtime"

"github.com/pkg/errors"
)

var defaultLintersSettings = LintersSettings{
Decorder: DecorderSettings{
Expand Down Expand Up @@ -47,6 +51,9 @@ var defaultLintersSettings = LintersSettings{
LangVersion: "",
ExtraRules: false,
},
Gosec: GoSecSettings{
Concurrency: runtime.NumCPU(),
},
Ifshort: IfshortSettings{
MaxDeclLines: 1,
MaxDeclChars: 30,
Expand Down Expand Up @@ -355,12 +362,13 @@ type GoModGuardSettings struct {
}

type GoSecSettings struct {
Includes []string
Excludes []string
Severity string
Confidence string
Includes []string `mapstructure:"includes"`
Excludes []string `mapstructure:"excludes"`
Severity string `mapstructure:"severity"`
Confidence string `mapstructure:"confidence"`
ExcludeGenerated bool `mapstructure:"exclude-generated"`
Config map[string]interface{} `mapstructure:"config"`
Concurrency int `mapstructure:"concurrency"`
}

type GovetSettings struct {
Expand Down
2 changes: 1 addition & 1 deletion pkg/golinters/gosec.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func NewGosec(settings *config.GoSecSettings) *goanalysis.Linter {
nil,
).WithContextSetter(func(lintCtx *linter.Context) {
analyzer.Run = func(pass *analysis.Pass) (interface{}, error) {
gosecAnalyzer := gosec.NewAnalyzer(gasConfig, true, settings.ExcludeGenerated, false, logger)
gosecAnalyzer := gosec.NewAnalyzer(gasConfig, true, settings.ExcludeGenerated, false, settings.Concurrency, logger)
gosecAnalyzer.LoadRules(ruleDefinitions.RulesInfo())

pkg := &packages.Package{
Expand Down

0 comments on commit 6fc688a

Please sign in to comment.