Skip to content

Commit 6827c19

Browse files
Abirdcflyldez
andauthored
build(deps): bump github.com/Abirdcfly/dupword from 0.1.7 to 0.1.8 (#6569)
Co-authored-by: Fernandez Ludovic <ldez@users.noreply.github.com>
1 parent d76c25d commit 6827c19

8 files changed

Lines changed: 36 additions & 9 deletions

File tree

.golangci.next.reference.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,9 @@ linters:
411411
# Checks only comments, skip strings.
412412
# Default: false
413413
comments-only: true
414+
# Skip raw string literals (backtick-delimited) from duplicate word checking.
415+
# Default: false
416+
skip-raw-strings: true
414417

415418
embeddedstructfieldcheck:
416419
# 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
@@ -20,7 +20,7 @@ require (
2020
codeberg.org/polyfloyd/go-errorlint v1.9.0
2121
dev.gaijin.team/go/exhaustruct/v4 v4.0.0
2222
github.com/4meepo/tagalign v1.4.3
23-
github.com/Abirdcfly/dupword v0.1.7
23+
github.com/Abirdcfly/dupword v0.1.8
2424
github.com/AdminBenni/iota-mixing v1.0.0
2525
github.com/AlwxSin/noinlineerr v1.0.5
2626
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
@@ -989,6 +989,11 @@
989989
"description": "Checks only comments, skip strings.",
990990
"type": "boolean",
991991
"default": false
992+
},
993+
"skip-raw-strings": {
994+
"description": "Skip raw string literals (backtick-delimited) from duplicate word checking.",
995+
"type": "boolean",
996+
"default": false
992997
}
993998
}
994999
},

pkg/config/linters_settings.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -414,9 +414,10 @@ type DuplSettings struct {
414414
}
415415

416416
type DupWordSettings struct {
417-
Keywords []string `mapstructure:"keywords"`
418-
Ignore []string `mapstructure:"ignore"`
419-
CommentsOnly bool `mapstructure:"comments-only"`
417+
Keywords []string `mapstructure:"keywords"`
418+
Ignore []string `mapstructure:"ignore"`
419+
CommentsOnly bool `mapstructure:"comments-only"`
420+
SkipRawStrings bool `mapstructure:"skip-raw-strings"`
420421
}
421422

422423
type EmbeddedStructFieldCheckSettings struct {

pkg/golinters/dupword/dupword.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ 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, ","),
19-
"comments-only": settings.CommentsOnly,
17+
"keyword": strings.Join(settings.Keywords, ","),
18+
"ignore": strings.Join(settings.Ignore, ","),
19+
"comments-only": settings.CommentsOnly,
20+
"skip-raw-strings": settings.SkipRawStrings,
2021
}
2122
}
2223

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
//golangcitest:args -Edupword
2+
//golangcitest:config_path testdata/dupword_skip_raw_strings.yml
3+
package testdata
4+
5+
import "fmt"
6+
7+
func duplicateWordInRawString() {
8+
// this line include duplicated word the the // want `Duplicate words \(the\) found`
9+
s := `this line include duplicated word the the` // skip-raw-strings should skip this
10+
fmt.Println(s)
11+
}
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+
skip-raw-strings: true

0 commit comments

Comments
 (0)