Skip to content
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
63 changes: 35 additions & 28 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,40 @@
linters:
enable:
- asciicheck
- bodyclose
- depguard
- dogsled
- durationcheck
- errcheck
- errorlint
- exportloopref
- gci
- gofmt
- gofumpt
- goimports
- gosec
- gosimple
- govet
- importas
- ineffassign
- megacheck
- misspell
- nakedret
- nolintlint
- revive
- staticcheck
- typecheck
- unconvert
- unparam
- unused
- wastedassign
- asciicheck
- bodyclose
- depguard
- dogsled
- durationcheck
- errcheck
- errorlint
- exportloopref
- gci
- gofmt
- gofumpt
- goimports
- gosec
- gosimple
- govet
- importas
- ineffassign
- megacheck
- misspell
- nakedret
- nolintlint
- revive
- staticcheck
- typecheck
- unconvert
- unparam
- unused
- wastedassign

linters-settings:
gci:
sections:
- standard
- default
- prefix(github.com/securego)

run:
timeout: 5m
3 changes: 2 additions & 1 deletion analyzers/ssrf.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@
package analyzers

import (
"github.com/securego/gosec/v2/issue"
"golang.org/x/tools/go/analysis"
"golang.org/x/tools/go/analysis/passes/buildssa"
"golang.org/x/tools/go/ssa"

"github.com/securego/gosec/v2/issue"
)

func newSSRFAnalyzer(id string, description string) *analysis.Analyzer {
Expand Down
3 changes: 2 additions & 1 deletion analyzers/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ import (
"os"
"strconv"

"github.com/securego/gosec/v2/issue"
"golang.org/x/tools/go/analysis"
"golang.org/x/tools/go/analysis/passes/buildssa"

"github.com/securego/gosec/v2/issue"
)

// SSAAnalyzerResult contains various information returned by the
Expand Down
1 change: 1 addition & 0 deletions call_list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"

"github.com/securego/gosec/v2"
"github.com/securego/gosec/v2/testutils"
)
Expand Down
1 change: 1 addition & 0 deletions cmd/gosec/sort_issues_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"

"github.com/securego/gosec/v2/issue"
)

Expand Down
1 change: 1 addition & 0 deletions config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"

"github.com/securego/gosec/v2"
)

Expand Down
1 change: 1 addition & 0 deletions cwe/data_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package cwe_test
import (
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"

"github.com/securego/gosec/v2/cwe"
)

Expand Down
1 change: 1 addition & 0 deletions cwe/types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package cwe_test
import (
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"

"github.com/securego/gosec/v2/cwe"
)

Expand Down
1 change: 1 addition & 0 deletions flag_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"

"github.com/securego/gosec/v2/cmd/vflag"
)

Expand Down
1 change: 1 addition & 0 deletions helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"

"github.com/securego/gosec/v2"
"github.com/securego/gosec/v2/testutils"
)
Expand Down
1 change: 1 addition & 0 deletions import_tracker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package gosec_test
import (
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"

"github.com/securego/gosec/v2"
"github.com/securego/gosec/v2/testutils"
)
Expand Down
1 change: 1 addition & 0 deletions issue/issue_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"

"github.com/securego/gosec/v2"
"github.com/securego/gosec/v2/issue"
"github.com/securego/gosec/v2/rules"
Expand Down
3 changes: 2 additions & 1 deletion report/formatter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ import (

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"gopkg.in/yaml.v3"

"github.com/securego/gosec/v2"
"github.com/securego/gosec/v2/cwe"
"github.com/securego/gosec/v2/issue"
"github.com/securego/gosec/v2/report/junit"
"github.com/securego/gosec/v2/report/sonar"
"gopkg.in/yaml.v3"
)

func createIssueWithFileWhat(file, what string) *issue.Issue {
Expand Down
1 change: 1 addition & 0 deletions report/sarif/formatter.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"strings"

"github.com/google/uuid"

"github.com/securego/gosec/v2"
"github.com/securego/gosec/v2/cwe"
"github.com/securego/gosec/v2/issue"
Expand Down
1 change: 1 addition & 0 deletions report/sarif/sarif_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"

"github.com/securego/gosec/v2"
"github.com/securego/gosec/v2/issue"
"github.com/securego/gosec/v2/report/sarif"
Expand Down
1 change: 1 addition & 0 deletions report/sonar/sonar_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package sonar_test
import (
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"

"github.com/securego/gosec/v2"
"github.com/securego/gosec/v2/issue"
"github.com/securego/gosec/v2/report/sonar"
Expand Down
1 change: 1 addition & 0 deletions report/text/writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"text/template"

"github.com/gookit/color"

"github.com/securego/gosec/v2"
"github.com/securego/gosec/v2/issue"
)
Expand Down
3 changes: 2 additions & 1 deletion report/yaml/writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ package yaml
import (
"io"

"github.com/securego/gosec/v2"
"gopkg.in/yaml.v3"

"github.com/securego/gosec/v2"
)

// WriteReport write a report in yaml format to the output writer
Expand Down
1 change: 1 addition & 0 deletions resolve_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"

"github.com/securego/gosec/v2"
"github.com/securego/gosec/v2/testutils"
)
Expand Down
1 change: 1 addition & 0 deletions rule_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"

"github.com/securego/gosec/v2"
"github.com/securego/gosec/v2/issue"
)
Expand Down
1 change: 1 addition & 0 deletions rules/hardcoded_credentials.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"strconv"

zxcvbn "github.com/nbutton23/zxcvbn-go"

"github.com/securego/gosec/v2"
"github.com/securego/gosec/v2/issue"
)
Expand Down
1 change: 1 addition & 0 deletions rules/rules_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"

"github.com/securego/gosec/v2"
"github.com/securego/gosec/v2/rules"
"github.com/securego/gosec/v2/testutils"
Expand Down
3 changes: 2 additions & 1 deletion testutils/pkg.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ import (
"path"
"strings"

"github.com/securego/gosec/v2"
"golang.org/x/tools/go/packages"

"github.com/securego/gosec/v2"
)

type buildObj struct {
Expand Down