This is a follow up to my last issue (#1558).
Godoc-Lint v0.10.0 is now shipped as part of Golangci-lint v2.5.0. Since this repo uses the @latest version, I recommend using the linter through Golangci-lint to improve the CI performance (since all linters would share the same driver and pre/post-analysis), and easier maintenance.
I'm going to show the changes required for this to help with the maintainers' time in case they were interested in doing so. Needless to say I have already tested the changes locally.
Required changes
Currently, the Godoc-Lint is used in all_test.go:
|
func TestGodocLint(t *testing.T) { |
|
rungo(t, "run", "github.com/godoc-lint/godoc-lint/cmd/godoclint@v0.3.0", |
|
// TODO(https://github.com/googleapis/librarian/issues/1510): fix test |
|
"-exclude", "internal/sidekick", |
|
"./...") |
|
} |
This test function should be removed in favour of updating .golangci.yaml as below. Note that the exclusion of internal/sidekick and test files (which was already the default behavior of the linter) are also added.
version: "2"
linters:
# See https://golangci-lint.run/usage/linters for details.
default: none
enable:
- containedctx
- contextcheck
- fatcontext
- godoclint
- godot
- govet
- ineffassign
- misspell
- staticcheck
- unparam
- unused
- usetesting
exclusions:
rules:
- path: _test\.go$
linters:
- godoclint
# TODO(https://github.com/googleapis/librarian/issues/1510): fix test
- path: internal/sidekick
linters:
- godoclint
I'd be happy to contribute with a PR if that helps.
cc @julieqiu
This is a follow up to my last issue (#1558).
Godoc-Lint
v0.10.0is now shipped as part of Golangci-lintv2.5.0. Since this repo uses the@latestversion, I recommend using the linter through Golangci-lint to improve the CI performance (since all linters would share the same driver and pre/post-analysis), and easier maintenance.I'm going to show the changes required for this to help with the maintainers' time in case they were interested in doing so. Needless to say I have already tested the changes locally.
Required changes
Currently, the Godoc-Lint is used in
all_test.go:librarian/all_test.go
Lines 185 to 190 in 2ff8248
This test function should be removed in favour of updating
.golangci.yamlas below. Note that the exclusion ofinternal/sidekickand test files (which was already the default behavior of the linter) are also added.I'd be happy to contribute with a PR if that helps.
cc @julieqiu