Skip to content

Commit

Permalink
build(deps): bump github.com/maratori/testpackage from 1.0.1 to 1.1.0 (
Browse files Browse the repository at this point in the history
…golangci#2945)

Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
  • Loading branch information
2 people authored and SeigeC committed Apr 4, 2023
1 parent 8de9783 commit fed51b5
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .golangci.reference.yml
Expand Up @@ -1632,6 +1632,11 @@ linters-settings:
# Regexp pattern to skip files.
# Default: "(export|internal)_test\\.go"
skip-regexp: (export|internal)_test\.go
# List of packages that don't end with _test that tests are allowed to be in.
# Default: "main"
allow-packages:
- example
- main

thelper:
test:
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Expand Up @@ -55,7 +55,7 @@ require (
github.com/ldez/tagliatelle v0.3.1
github.com/leonklingele/grouper v1.1.0
github.com/lufeee/execinquery v1.2.1
github.com/maratori/testpackage v1.0.1
github.com/maratori/testpackage v1.1.0
github.com/matoous/godox v0.0.0-20210227103229-6504466cf951 // v1.0
github.com/mattn/go-colorable v0.1.12
github.com/mbilski/exhaustivestruct v1.2.0
Expand Down
5 changes: 2 additions & 3 deletions go.sum

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

6 changes: 4 additions & 2 deletions pkg/config/linters_settings.go
Expand Up @@ -88,7 +88,8 @@ var defaultLintersSettings = LintersSettings{
Qualified: false,
},
Testpackage: TestpackageSettings{
SkipRegexp: `(export|internal)_test\.go`,
SkipRegexp: `(export|internal)_test\.go`,
AllowPackages: []string{"main"},
},
Unparam: UnparamSettings{
Algo: "cha",
Expand Down Expand Up @@ -558,7 +559,8 @@ type TagliatelleSettings struct {
}

type TestpackageSettings struct {
SkipRegexp string `mapstructure:"skip-regexp"`
SkipRegexp string `mapstructure:"skip-regexp"`
AllowPackages []string `mapstructure:"allow-packages"`
}

type ThelperSettings struct {
Expand Down
5 changes: 4 additions & 1 deletion pkg/golinters/testpackage.go
@@ -1,6 +1,8 @@
package golinters

import (
"strings"

"github.com/maratori/testpackage/pkg/testpackage"
"golang.org/x/tools/go/analysis"

Expand All @@ -15,7 +17,8 @@ func NewTestpackage(cfg *config.TestpackageSettings) *goanalysis.Linter {
if cfg != nil {
settings = map[string]map[string]interface{}{
a.Name: {
testpackage.SkipRegexpFlagName: cfg.SkipRegexp,
testpackage.SkipRegexpFlagName: cfg.SkipRegexp,
testpackage.AllowPackagesFlagName: strings.Join(cfg.AllowPackages, ","),
},
}
}
Expand Down

0 comments on commit fed51b5

Please sign in to comment.