Skip to content

Commit

Permalink
Merge pull request #121672 from pohly/golangci-lint-comment-check-fix
Browse files Browse the repository at this point in the history
golangci-lint: tone down comment checking
  • Loading branch information
k8s-ci-robot authored Nov 1, 2023
2 parents 9747358 + 248100c commit 9e84a02
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 18 deletions.
10 changes: 10 additions & 0 deletions hack/golangci-hints.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,16 @@ issues:
- gocritic
text: "ifElseChain: rewrite if-else to switch statement"

# Only packages listed here opt into the strict "exported symbols must be documented".
#
# Exclude texts from https://github.com/golangci/golangci-lint/blob/ab3c3cd69e602ff53bb4c3e2c188f0caeb80305d/pkg/config/issues.go#L11-L103
- linters:
- golint
- revive
- stylecheck
text: comment on exported (method|function|type|const)|should have( a package)? comment|comment should be of the form|comment on exported (method|function|type|const)|should have( a package)? comment|comment should be of the form|exported (.+) should have comment( \(or a comment on this block\))? or be unexported|package comment should be of the form "(.+)...|comment on exported (.+) should be of the form "(.+)...|should have a package comment
path-except: cmd/kubeadm

linters:
disable-all: false
enable: # please keep this alphabetized
Expand Down
16 changes: 10 additions & 6 deletions hack/golangci-strict.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,16 @@ issues:
- gocritic
text: "ifElseChain: rewrite if-else to switch statement"

# Only packages listed here opt into the strict "exported symbols must be documented".
#
# Exclude texts from https://github.com/golangci/golangci-lint/blob/ab3c3cd69e602ff53bb4c3e2c188f0caeb80305d/pkg/config/issues.go#L11-L103
- linters:
- golint
- revive
- stylecheck
text: comment on exported (method|function|type|const)|should have( a package)? comment|comment should be of the form|comment on exported (method|function|type|const)|should have( a package)? comment|comment should be of the form|exported (.+) should have comment( \(or a comment on this block\))? or be unexported|package comment should be of the form "(.+)...|comment on exported (.+) should be of the form "(.+)...|should have a package comment
path-except: cmd/kubeadm

# The following issues were deemed "might be worth fixing, needs to be
# decided on a case-by-case basis". This was initially decided by a
# majority of the developers who voted in
Expand All @@ -93,12 +103,6 @@ issues:
- gosimple
text: "S1033: unnecessary guard around call to delete"

# Only packages listed here opt into the strict "exported symbols must be documented".
- linters:
- revive
text: "(exported: exported .* or be unexported|exported: comment on exported.*should be of the form)"
path-except: cmd/kubeadm

# Didn't make it into https://github.com/kubernetes/kubernetes/issues/117288.
# Discussion on Slack concluded that "it's hard to have a universal policy for all
# functions marked deprecated" and thus this can only be a hint which must
Expand Down
16 changes: 10 additions & 6 deletions hack/golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,16 @@ issues:
- gocritic
text: "ifElseChain: rewrite if-else to switch statement"

# Only packages listed here opt into the strict "exported symbols must be documented".
#
# Exclude texts from https://github.com/golangci/golangci-lint/blob/ab3c3cd69e602ff53bb4c3e2c188f0caeb80305d/pkg/config/issues.go#L11-L103
- linters:
- golint
- revive
- stylecheck
text: comment on exported (method|function|type|const)|should have( a package)? comment|comment should be of the form|comment on exported (method|function|type|const)|should have( a package)? comment|comment should be of the form|exported (.+) should have comment( \(or a comment on this block\))? or be unexported|package comment should be of the form "(.+)...|comment on exported (.+) should be of the form "(.+)...|should have a package comment
path-except: cmd/kubeadm

# The following issues were deemed "might be worth fixing, needs to be
# decided on a case-by-case basis". This was initially decided by a
# majority of the developers who voted in
Expand All @@ -99,12 +109,6 @@ issues:
- gosimple
text: "S1033: unnecessary guard around call to delete"

# Only packages listed here opt into the strict "exported symbols must be documented".
- linters:
- revive
text: "(exported: exported .* or be unexported|exported: comment on exported.*should be of the form)"
path-except: cmd/kubeadm

# Didn't make it into https://github.com/kubernetes/kubernetes/issues/117288.
# Discussion on Slack concluded that "it's hard to have a universal policy for all
# functions marked deprecated" and thus this can only be a hint which must
Expand Down
16 changes: 10 additions & 6 deletions hack/golangci.yaml.in
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,16 @@ issues:
- gocritic
text: "ifElseChain: rewrite if-else to switch statement"

# Only packages listed here opt into the strict "exported symbols must be documented".
#
# Exclude texts from https://github.com/golangci/golangci-lint/blob/ab3c3cd69e602ff53bb4c3e2c188f0caeb80305d/pkg/config/issues.go#L11-L103
- linters:
- golint
- revive
- stylecheck
text: comment on exported (method|function|type|const)|should have( a package)? comment|comment should be of the form|comment on exported (method|function|type|const)|should have( a package)? comment|comment should be of the form|exported (.+) should have comment( \(or a comment on this block\))? or be unexported|package comment should be of the form "(.+)...|comment on exported (.+) should be of the form "(.+)...|should have a package comment
path-except: cmd/kubeadm

{{- if not .Hints}}

# The following issues were deemed "might be worth fixing, needs to be
Expand Down Expand Up @@ -104,12 +114,6 @@ issues:
- gosimple
text: "S1033: unnecessary guard around call to delete"

# Only packages listed here opt into the strict "exported symbols must be documented".
- linters:
- revive
text: "(exported: exported .* or be unexported|exported: comment on exported.*should be of the form)"
path-except: cmd/kubeadm

# Didn't make it into https://github.com/kubernetes/kubernetes/issues/117288.
# Discussion on Slack concluded that "it's hard to have a universal policy for all
# functions marked deprecated" and thus this can only be a hint which must
Expand Down

0 comments on commit 9e84a02

Please sign in to comment.