Skip to content

Commit

Permalink
Merge pull request kubernetes#117551 from pohly/lint-pull-requests
Browse files Browse the repository at this point in the history
golangci-lint: allow exceptions for Go naming convention
  • Loading branch information
k8s-ci-robot authored Apr 24, 2023
2 parents 5fa78f4 + 4169d7d commit 1def77f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions hack/golangci-strict.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ issues:
- path: conversion\.go
linters:
- ineffassign
# The Kubernetes naming convention for conversion functions uses underscores
# and intentionally deviates from normal Go conventions to make those function
# names more readable. Same for SetDefaults_*.
- linters:
- stylecheck
text: "ST1003: should not use underscores in Go names; func (Convert_.*_To_.*|SetDefaults_)"

linters:
disable-all: false # in contrast to golangci.yaml, the default set of linters remains enabled
Expand Down
6 changes: 6 additions & 0 deletions hack/golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ issues:
- path: (pkg/volume/*|test/*|azure/*|pkg/cmd/wait*|request/bearertoken/*|metrics/*|filters/*) # not in golangci-strict.yaml
linters: # not in golangci-strict.yaml
- gocritic # not in golangci-strict.yaml
# The Kubernetes naming convention for conversion functions uses underscores
# and intentionally deviates from normal Go conventions to make those function
# names more readable. Same for SetDefaults_*.
- linters:
- stylecheck
text: "ST1003: should not use underscores in Go names; func (Convert_.*_To_.*|SetDefaults_)"

linters:
disable-all: true # not disabled in golangci-strict.yaml
Expand Down

0 comments on commit 1def77f

Please sign in to comment.