Skip to content

Commit 21e4af2

Browse files
committed
fix: upgrade to godoclint v0.10.0
With this version, the `deprecated` rule is enabled by default, so the default config test cases had to be updated. Signed-off-by: Babak K. Shandiz <[email protected]>
1 parent 23ab774 commit 21e4af2

File tree

5 files changed

+32
-4
lines changed

5 files changed

+32
-4
lines changed

.golangci.next.reference.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1271,7 +1271,7 @@ linters:
12711271
godoclint:
12721272
# Default set of rules to enable.
12731273
# Possible values are: `basic`, `all` or `none`.
1274-
# Default: `basic` (enables `pkg-doc`, `single-pkg-doc`, and `start-with-name`)
1274+
# Default: `basic` (enables `pkg-doc`, `single-pkg-doc`, `start-with-name`, and `deprecated`)
12751275
default: all
12761276

12771277
# List of rules to enable in addition to the default set.

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ require (
4545
github.com/go-critic/go-critic v0.13.0
4646
github.com/go-viper/mapstructure/v2 v2.4.0
4747
github.com/go-xmlfmt/xmlfmt v1.1.3
48-
github.com/godoc-lint/godoc-lint v0.9.0
48+
github.com/godoc-lint/godoc-lint v0.10.0
4949
github.com/gofrs/flock v0.12.1
5050
github.com/golangci/asciicheck v0.5.0
5151
github.com/golangci/dupl v0.0.0-20250308024227-f665c8d69b32

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.

pkg/golinters/godoclint/testdata/godoclint_default_fail.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,18 @@ func FooFunc() {}
2424

2525
// bad godoc // want `godoc should start with symbol name \("FooFunc"\)`
2626
func (FooType) FooFunc() {}
27+
28+
// DeprecatedConstA is... // want `deprecation note should be formatted as "Deprecated: "`
29+
//
30+
// DEPRECATED: do not use
31+
const DeprecatedConstA = 1
32+
33+
// DeprecatedConstB is... // want `deprecation note should be formatted as "Deprecated: "`
34+
//
35+
// DEPRECATED:do not use
36+
const DeprecatedConstB = 1
37+
38+
// DeprecatedConstC is... // want `deprecation note should be formatted as "Deprecated: "`
39+
//
40+
// deprecated:do not use
41+
const DeprecatedConstC = 1

pkg/golinters/godoclint/testdata/godoclint_default_pass.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,16 @@ func fooFunc() {}
4343

4444
// bad godoc on unexported symbol
4545
func (FooType) fooFunc() {}
46+
47+
// DeprecatedConstA is...
48+
//
49+
// Deprecated: do not use
50+
const DeprecatedConstA = 1
51+
52+
// Deprecated: do not use
53+
const DeprecatedConstB = 1
54+
55+
// deprecatedConstC is...
56+
//
57+
// DEPRECATED: invalid deprecation note but okay since the symbol is not exported
58+
const deprecatedConstC = 1

0 commit comments

Comments
 (0)