Skip to content

Commit 95edd30

Browse files
Abirdcflyldez
andauthored
build(deps): bump github.com/Abirdcfly/dupword from 0.0.12 to 0.0.13 (#4104)
Co-authored-by: Fernandez Ludovic <[email protected]>
1 parent c9956e8 commit 95edd30

File tree

7 files changed

+32
-6
lines changed

7 files changed

+32
-6
lines changed

.golangci.reference.yml

+7-3
Original file line numberDiff line numberDiff line change
@@ -235,9 +235,13 @@ linters-settings:
235235
# If this list is not empty, only the words defined in this list will be detected.
236236
# Default: []
237237
keywords:
238-
- "the"
239-
- "and"
240-
- "a"
238+
- "the"
239+
- "and"
240+
- "a"
241+
# Keywords used to ignore detection.
242+
# Default: []
243+
ignore:
244+
- "0C0C"
241245

242246
errcheck:
243247
# Report about not checking of errors in type assertions: `a := b.(MyStruct)`.

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ require (
66
4d63.com/gocheckcompilerdirectives v1.2.1
77
4d63.com/gochecknoglobals v0.2.1
88
github.com/4meepo/tagalign v1.3.2
9-
github.com/Abirdcfly/dupword v0.0.12
9+
github.com/Abirdcfly/dupword v0.0.13
1010
github.com/Antonboom/errname v0.1.12
1111
github.com/Antonboom/nilnil v0.1.7
1212
github.com/BurntSushi/toml v1.3.2

go.sum

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/config/linters_settings.go

+1
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,7 @@ type DuplSettings struct {
292292

293293
type DupWordSettings struct {
294294
Keywords []string `mapstructure:"keywords"`
295+
Ignore []string `mapstructure:"ignore"`
295296
}
296297

297298
type ErrcheckSettings struct {

pkg/golinters/dupword.go

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ func NewDupWord(setting *config.DupWordSettings) *goanalysis.Linter {
1717
if setting != nil {
1818
cfgMap[a.Name] = map[string]any{
1919
"keyword": strings.Join(setting.Keywords, ","),
20+
"ignore": strings.Join(setting.Ignore, ","),
2021
}
2122
}
2223

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
linters-settings:
2+
dupword:
3+
ignore:
4+
- "the"

test/testdata/dupword_ignore_the.go

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//golangcitest:args -Edupword
2+
//golangcitest:config_path testdata/configs/dupword_ignore_the.yml
3+
package testdata
4+
5+
import "fmt"
6+
7+
func duplicateWordInComments() {
8+
// this line include duplicated word the the
9+
fmt.Println("hello")
10+
}
11+
12+
func duplicateWordInStr() {
13+
a := "this line include duplicate word and and" // want `Duplicate words \(and\) found`
14+
b := "print the\n the line, print the the \n\t the line. and and" // want `Duplicate words \(and\) found`
15+
fmt.Println(a, b)
16+
}

0 commit comments

Comments
 (0)