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/maratori/testpackage from 1.0.1 to 1.1.0 #2945

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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions .golangci.reference.yml
Expand Up @@ -1607,6 +1607,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"
ldez marked this conversation as resolved.
Show resolved Hide resolved
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