Skip to content

Commit 264a6a0

Browse files
authored
fix: run godoclint via golangci-lint (#2751)
godoclint is now bundled with golangci-lint, so switch to using it through golangci-lint directly. This change also resolves existing lint errors surfaced by the new configuration. Additionally, remove a stale TODO referenced in #1510. Fixes #2371
1 parent 6bce27d commit 264a6a0

File tree

8 files changed

+8
-17
lines changed

8 files changed

+8
-17
lines changed

.golangci.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ linters:
2121
- containedctx
2222
- contextcheck
2323
- fatcontext
24+
- godoclint
2425
- godot
2526
- govet
2627
- ineffassign

all_test.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -246,13 +246,6 @@ func TestGovulncheck(t *testing.T) {
246246
rungo(t, "run", "golang.org/x/vuln/cmd/[email protected]", "./...")
247247
}
248248

249-
func TestGodocLint(t *testing.T) {
250-
rungo(t, "run", "github.com/godoc-lint/godoc-lint/cmd/[email protected]",
251-
// TODO(https://github.com/googleapis/librarian/issues/1510): fix test
252-
"-exclude", "internal/sidekick",
253-
"./...")
254-
}
255-
256249
func rungo(t *testing.T, args ...string) {
257250
t.Helper()
258251

internal/container/java/pom/pom_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
14+
1415
package pom
1516

1617
import (

internal/images/images_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
// Package images provides operations around docker images.
1615
package images
1716

1817
import (

internal/sidekick/internal/config/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ type DocumentationOverride struct {
4343
Replace string `toml:"replace"`
4444
}
4545

46-
// PaginationOverrides describes overrides for pagination config of a method.
46+
// PaginationOverride describes overrides for pagination config of a method.
4747
type PaginationOverride struct {
4848
// The method ID.
4949
ID string `toml:"id"`

internal/sidekick/internal/config/gcloudyaml/gcloud_test.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ import (
2626
)
2727

2828
func TestGcloudConfig(t *testing.T) {
29-
// TODO(https://github.com/googleapis/librarian/issues/1510): fix test
30-
t.Skip()
31-
3229
data, err := os.ReadFile("testdata/gcloud.yaml")
3330
if err != nil {
3431
t.Fatalf("failed to read temporary YAML file: %v", err)

internal/sidekick/internal/config/update_root_config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ func UpdateRootConfig(rootConfig *Config, rootName string) error {
8383
return os.WriteFile(configName, newContents, 0644)
8484
}
8585

86-
// githubConfig returns the API endpoint the browser endpoint for GitHub.
86+
// githubConfig returns the GitHub API and download endpoints.
8787
// In tests, these are replaced with a fake.
8888
func githubConfig(rootConfig *Config) *githubEndpoints {
8989
api, ok := rootConfig.Source["github-api"]

internal/sidekick/internal/parser/svcconfig/svcconfig.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
// serviceconfig contains helper functions to parse service config files.
15+
// Package svcconfig contains helper functions to parse service config files.
1616
package svcconfig
1717

1818
import (
@@ -27,7 +27,7 @@ type ServiceNames struct {
2727
ServiceName string
2828
}
2929

30-
// ExtractServiceNames determines the package name and service implied by a
30+
// ExtractPackageName determines the package name and service implied by a
3131
// service config file.
3232
func ExtractPackageName(serviceConfig *serviceconfig.Service) *ServiceNames {
3333
if serviceConfig == nil {
@@ -43,7 +43,7 @@ func ExtractPackageName(serviceConfig *serviceconfig.Service) *ServiceNames {
4343
return nil
4444
}
4545

46-
// SplitQualifiedServiceName splits a service name into the package name and the
46+
// splitQualifiedServiceName splits a service name into the package name and the
4747
// unqualified service name.
4848
func splitQualifiedServiceName(name string) ServiceNames {
4949
li := strings.LastIndex(name, ".")
@@ -53,7 +53,7 @@ func splitQualifiedServiceName(name string) ServiceNames {
5353
return ServiceNames{PackageName: name[:li], ServiceName: name[li+1:]}
5454
}
5555

56-
// WellKnownmixin returns true if the qualified service name is one of the
56+
// wellKnownMixin returns true if the qualified service name is one of the
5757
// well-known mixins.
5858
func wellKnownMixin(qualifiedServiceName string) bool {
5959
return strings.HasPrefix(qualifiedServiceName, "google.cloud.location.Location") ||

0 commit comments

Comments
 (0)