Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(deps): bump github.com/securego/gosec/v2 from 2.9.6 to 2.10.0 #2624

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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