Skip to content

Commit 2d12ce2

Browse files
committed
chore: groups gosec files to a package
1 parent 34b9773 commit 2d12ce2

11 files changed

+23
-11
lines changed

pkg/golinters/gosec.go renamed to pkg/golinters/gosec/gosec.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package golinters
1+
package gosec
22

33
import (
44
"fmt"
@@ -21,9 +21,9 @@ import (
2121
"github.com/golangci/golangci-lint/pkg/result"
2222
)
2323

24-
const gosecName = "gosec"
24+
const name = "gosec"
2525

26-
func NewGosec(settings *config.GoSecSettings) *goanalysis.Linter {
26+
func New(settings *config.GoSecSettings) *goanalysis.Linter {
2727
var mu sync.Mutex
2828
var resIssues []goanalysis.Issue
2929

@@ -39,13 +39,13 @@ func NewGosec(settings *config.GoSecSettings) *goanalysis.Linter {
3939
ruleDefinitions := rules.Generate(false, filters...)
4040

4141
analyzer := &analysis.Analyzer{
42-
Name: gosecName,
42+
Name: name,
4343
Doc: goanalysis.TheOnlyanalyzerDoc,
4444
Run: goanalysis.DummyRun,
4545
}
4646

4747
return goanalysis.NewLinter(
48-
gosecName,
48+
name,
4949
"Inspects source code for security problems",
5050
[]*analysis.Analyzer{analyzer},
5151
nil,
@@ -126,7 +126,7 @@ func runGoSec(lintCtx *linter.Context, pass *analysis.Pass, settings *config.GoS
126126
},
127127
Text: text,
128128
LineRange: r,
129-
FromLinter: gosecName,
129+
FromLinter: name,
130130
}, pass))
131131
}
132132

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package gosec
2+
3+
import (
4+
"testing"
5+
6+
"github.com/golangci/golangci-lint/test/testshared/integration"
7+
)
8+
9+
func TestFromTestdata(t *testing.T) {
10+
integration.RunTestdata(t)
11+
}

pkg/golinters/gosec_test.go renamed to pkg/golinters/gosec/gosec_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package golinters
1+
package gosec
22

33
import (
44
"testing"
File renamed without changes.

test/testdata/gosec_global_option.go renamed to pkg/golinters/gosec/testdata/gosec_global_option.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//golangcitest:args -Egosec
2-
//golangcitest:config_path testdata/configs/gosec_global_option.yml
2+
//golangcitest:config_path testdata/gosec_global_option.yml
33
package testdata
44

55
import (

test/testdata/gosec_rules_config.go renamed to pkg/golinters/gosec/testdata/gosec_rules_config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//golangcitest:args -Egosec
2-
//golangcitest:config_path testdata/configs/gosec.yml
2+
//golangcitest:config_path testdata/gosec.yml
33
package testdata
44

55
import "io/ioutil"

test/testdata/gosec_severity_confidence.go renamed to pkg/golinters/gosec/testdata/gosec_severity_confidence.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//golangcitest:args -Egosec
2-
//golangcitest:config_path testdata/configs/gosec_severity_confidence.yml
2+
//golangcitest:config_path testdata/gosec_severity_confidence.yml
33
package testdata
44

55
import (

0 commit comments

Comments
 (0)