Skip to content

Commit

Permalink
build(deps): bump github.com/Abirdcfly/dupword from 0.0.12 to 0.0.13 (#…
Browse files Browse the repository at this point in the history
…4104)

Co-authored-by: Fernandez Ludovic <[email protected]>
  • Loading branch information
Abirdcfly and ldez authored Sep 25, 2023
1 parent c9956e8 commit 95edd30
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 6 deletions.
10 changes: 7 additions & 3 deletions .golangci.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,13 @@ linters-settings:
# If this list is not empty, only the words defined in this list will be detected.
# Default: []
keywords:
- "the"
- "and"
- "a"
- "the"
- "and"
- "a"
# Keywords used to ignore detection.
# Default: []
ignore:
- "0C0C"

errcheck:
# Report about not checking of errors in type assertions: `a := b.(MyStruct)`.
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require (
4d63.com/gocheckcompilerdirectives v1.2.1
4d63.com/gochecknoglobals v0.2.1
github.com/4meepo/tagalign v1.3.2
github.com/Abirdcfly/dupword v0.0.12
github.com/Abirdcfly/dupword v0.0.13
github.com/Antonboom/errname v0.1.12
github.com/Antonboom/nilnil v0.1.7
github.com/BurntSushi/toml v1.3.2
Expand Down
4 changes: 2 additions & 2 deletions go.sum

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

1 change: 1 addition & 0 deletions pkg/config/linters_settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ type DuplSettings struct {

type DupWordSettings struct {
Keywords []string `mapstructure:"keywords"`
Ignore []string `mapstructure:"ignore"`
}

type ErrcheckSettings struct {
Expand Down
1 change: 1 addition & 0 deletions pkg/golinters/dupword.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ func NewDupWord(setting *config.DupWordSettings) *goanalysis.Linter {
if setting != nil {
cfgMap[a.Name] = map[string]any{
"keyword": strings.Join(setting.Keywords, ","),
"ignore": strings.Join(setting.Ignore, ","),
}
}

Expand Down
4 changes: 4 additions & 0 deletions test/testdata/configs/dupword_ignore_the.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
linters-settings:
dupword:
ignore:
- "the"
16 changes: 16 additions & 0 deletions test/testdata/dupword_ignore_the.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//golangcitest:args -Edupword
//golangcitest:config_path testdata/configs/dupword_ignore_the.yml
package testdata

import "fmt"

func duplicateWordInComments() {
// this line include duplicated word the the
fmt.Println("hello")
}

func duplicateWordInStr() {
a := "this line include duplicate word and and" // want `Duplicate words \(and\) found`
b := "print the\n the line, print the the \n\t the line. and and" // want `Duplicate words \(and\) found`
fmt.Println(a, b)
}

0 comments on commit 95edd30

Please sign in to comment.