Skip to content

Commit

Permalink
fix: linter issues
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
  • Loading branch information
caarlos0 committed Feb 10, 2022
1 parent c593736 commit b6ef6d9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 34 deletions.
32 changes: 0 additions & 32 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,3 @@ linters:
- gci
- exhaustivestruct
- varnamelen
linters-settings:
maligned:
# print struct with more effective memory layout or not, false by default
suggest-new: true
gocyclo:
# minimal code complexity to report, 30 by default (but we recommend 10-20)
min-complexity: 30
goimports:
# put imports beginning with prefix after 3rd-party packages;
# it's a comma-separated list of prefixes
local-prefixes: github.com/goreleaser/fileglob
govet:
check-shadowing: true
errcheck:
ignore: ^Close.*,fmt:.*,github.com/pkg/errors:^Wrap.*,os:^Setenv$
lll:
line-length: 200
golint:
min-confidence: .8
nakedret:
max-func-lines: 0
gocritic:
disabled-checks:
- whyNoLint
enabled-tags:
- style
- performance
issues:
exclude-rules:
- text: "G104" # gosec G104 is caught by errcheck
linters:
- gosec
10 changes: 8 additions & 2 deletions glob_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ func TestGlob(t *testing.T) { // nolint:funlen
toNixPath(filepath.Join(wd, "glob_test.go")),
toNixPath(filepath.Join(wd, "prefix_test.go")),
}, matches)
is.Equal(fmt.Sprintf("&{fs:%s matchDirectoriesDirectly:false prefix:%s pattern:%s}", prefix, prefix, pattern), w.String())
is.Equal(fmt.Sprintf(
"&{fs:%s matchDirectoriesDirectly:false prefix:%s pattern:%s}",
prefix, prefix, pattern,
), w.String())
})

t.Run("real with rootfs direct file", func(t *testing.T) {
Expand Down Expand Up @@ -98,7 +101,10 @@ func TestGlob(t *testing.T) { // nolint:funlen
is.True(err != nil) // expected an error
is.True(strings.HasSuffix(err.Error(), "file does not exist")) // should have been file does not exist
is.Equal([]string{}, matches)
is.Equal(fmt.Sprintf("&{fs:%s matchDirectoriesDirectly:false prefix:%s pattern:%s}", prefix, prefix, glob.QuoteMeta(abs)), w.String())
is.Equal(fmt.Sprintf(
"&{fs:%s matchDirectoriesDirectly:false prefix:%s pattern:%s}",
prefix, prefix, glob.QuoteMeta(abs),
), w.String())
})

t.Run("real with rootfs on relative path to parent", func(t *testing.T) {
Expand Down

0 comments on commit b6ef6d9

Please sign in to comment.