forked from kubernetes/kubernetes
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
hack: integrate logcheck into golangci-lint
Running logcheck as part of golangci-lint has several advantages: - faster checking because finding files and parsing is shared with other linters - gets rid of the complex and buggy hack/verify-structured-logging.sh (kubernetes#106746) - support for // nolint:logcheck - works with Go 1.18 Replay of 17e3c55
- Loading branch information
Showing
7 changed files
with
109 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# This file contains regular expressions that are matched against <pkg>/<file>, | ||
# for example k8s.io/cmd/kube-scheduler/app/config/config.go. | ||
# | ||
# By default, structured logging call parameters are checked, but usage of | ||
# those calls is not required. That is changed on a per-file basis. | ||
# | ||
# Remember to clean the golangci-lint cache when changing the configuration and | ||
# running the verify-golangci-lint.sh script multiple times, otherwise | ||
# golangci-lint will report stale results: | ||
# _output/local/bin/golangci-lint cache clean | ||
|
||
# At this point we don't enforce the usage structured logging calls except in | ||
# those packages that were migrated. This disables the check for other files. | ||
-structured .* | ||
|
||
# Now enable it again for migrated packages. | ||
structured k8s.io/kubernetes/cmd/kube-proxy/.* | ||
structured k8s.io/kubernetes/cmd/kube-scheduler/.* | ||
structured k8s.io/kubernetes/cmd/kubelet/.* | ||
structured k8s.io/kubernetes/pkg/kubelet/.* | ||
structured k8s.io/kubernetes/pkg/proxy/.* | ||
structured k8s.io/kubernetes/pkg/scheduler/.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.