Skip to content

Commit b99da87

Browse files
build(deps): bump github.com/Abirdcfly/dupword from 0.1.6 to 0.1.7 (#6142)
Co-authored-by: Fernandez Ludovic <[email protected]>
1 parent 95f94ff commit b99da87

File tree

10 files changed

+40
-8
lines changed

10 files changed

+40
-8
lines changed

.golangci.next.reference.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,9 @@ linters:
398398
# Default: []
399399
ignore:
400400
- "0C0C"
401+
# Checks only comments, skip strings.
402+
# Default: false
403+
comments-only: true
401404

402405
embeddedstructfieldcheck:
403406
# Checks that there is an empty space between the embedded fields and regular fields.

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ require (
77
4d63.com/gochecknoglobals v0.2.2
88
dev.gaijin.team/go/exhaustruct/v4 v4.0.0
99
github.com/4meepo/tagalign v1.4.3
10-
github.com/Abirdcfly/dupword v0.1.6
10+
github.com/Abirdcfly/dupword v0.1.7
1111
github.com/AdminBenni/iota-mixing v1.0.0
1212
github.com/AlwxSin/noinlineerr v1.0.5
1313
github.com/Antonboom/errname v1.1.1

go.sum

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jsonschema/golangci.next.jsonschema.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -945,6 +945,11 @@
945945
"type": "string",
946946
"examples": ["0C0C"]
947947
}
948+
},
949+
"comments-only": {
950+
"description": "Checks only comments, skip strings.",
951+
"type": "boolean",
952+
"default": false
948953
}
949954
}
950955
},

pkg/config/linters_settings.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,8 +386,9 @@ type DuplSettings struct {
386386
}
387387

388388
type DupWordSettings struct {
389-
Keywords []string `mapstructure:"keywords"`
390-
Ignore []string `mapstructure:"ignore"`
389+
Keywords []string `mapstructure:"keywords"`
390+
Ignore []string `mapstructure:"ignore"`
391+
CommentsOnly bool `mapstructure:"comments-only"`
391392
}
392393

393394
type EmbeddedStructFieldCheckSettings struct {

pkg/golinters/dupword/dupword.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ func New(settings *config.DupWordSettings) *goanalysis.Linter {
1414

1515
if settings != nil {
1616
cfg = map[string]any{
17-
"keyword": strings.Join(settings.Keywords, ","),
18-
"ignore": strings.Join(settings.Ignore, ","),
17+
"keyword": strings.Join(settings.Keywords, ","),
18+
"ignore": strings.Join(settings.Ignore, ","),
19+
"comments-only": settings.CommentsOnly,
1920
}
2021
}
2122

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//golangcitest:args -Edupword
2+
//golangcitest:config_path testdata/dupword_comments_only.yml
3+
package testdata
4+
5+
import "fmt"
6+
7+
func _() {
8+
// want +2 `Duplicate words \(and\) found`
9+
// want +2 `Duplicate words \(and,the\) found`
10+
// this line include duplicate word and and
11+
// print the\n the line, print the the \n\t the line. and and
12+
13+
a := "this line include duplicate word and and"
14+
b := "print the\n the line, print the the \n\t the line. and and"
15+
fmt.Println(a, b)
16+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: "2"
2+
3+
linters:
4+
settings:
5+
dupword:
6+
comments-only: true

pkg/golinters/dupword/testdata/dupword_ignore_the.go renamed to pkg/golinters/dupword/testdata/dupword_ignore.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//golangcitest:args -Edupword
2-
//golangcitest:config_path testdata/dupword_ignore_the.yml
2+
//golangcitest:config_path testdata/dupword_ignore.yml
33
package testdata
44

55
import "fmt"

0 commit comments

Comments
 (0)