-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 golangci-lint should use go-build tags appropriately #5540
Conversation
3ebd037
to
ed508a1
Compare
@@ -62,10 +62,6 @@ def get_refs(): | |||
return refs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file was updated from upstream https://github.com/kubernetes/kubernetes/blob/4dfd73940396730caf331e35cbb28235d233f2a0/hack/boilerplate/boilerplate.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add a comment somewhere (top of the file or a README.md) where we got/sync the file from? (I assume this also applies to the other boilerplate files)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a readme, given that the whole folder was copied
ed508a1
to
b18673f
Compare
/assign @sbueringer @fabriziopandini |
@@ -62,10 +62,6 @@ def get_refs(): | |||
return refs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add a comment somewhere (top of the file or a README.md) where we got/sync the file from? (I assume this also applies to the other boilerplate files)
@@ -28,10 +29,13 @@ import ( | |||
"sigs.k8s.io/kubebuilder/docs/book/utils/plugin" | |||
) | |||
|
|||
// Tabulate. | |||
// Tabulate adds support for switchable tabls in mdbook. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Tabulate adds support for switchable tabls in mdbook. | |
// Tabulate adds support for switchable tabs in mdbook. |
nit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tabls 😂
- linters: | ||
- typecheck | ||
text: import (".+") is a program, not an importable package | ||
path: ^tools\.go$ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: should we match the entire path and not only the filename?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't, the path is relative to where golanci-lint runs, which is the tools folder in this case. It's not ideal but that's also why I added a stricter validation here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yeah makes sense
@@ -1,3 +1,4 @@ | |||
//go:build tools |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way to enforce this going forward?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's enforced by golangci-lint now through gofmt, and you can use make lint-fix
b18673f
to
75d5013
Compare
Thx! |
75d5013
to
721a921
Compare
Signed-off-by: Vince Prignano <vincepri@vmware.com>
721a921
to
fb1f862
Compare
@@ -67,7 +67,7 @@ func initWebhookInstallOptions() envtest.WebhookInstallOptions { | |||
if err != nil { | |||
klog.Fatalf("Failed to append bootstrap controller webhook config: %v", err) | |||
} | |||
controlplaneyamlFile, err := os.ReadFile(filepath.Join(root, "controlplane", "kubeadm", "config", "webhook", "manifests.yaml")) | |||
controlplaneyamlFile, err := os.ReadFile(filepath.Join(root, "controlplane", "kubeadm", "config", "webhook", "manifests.yaml")) //nolint:Gosec |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
controlplaneyamlFile, err := os.ReadFile(filepath.Join(root, "controlplane", "kubeadm", "config", "webhook", "manifests.yaml")) //nolint:Gosec | |
controlplaneyamlFile, err := os.ReadFile(filepath.Join(root, "controlplane", "kubeadm", "config", "webhook", "manifests.yaml")) //nolint:gosec |
nit if you want
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More lint!
Thanks!
/approve
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: fabriziopandini The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Signed-off-by: Vince Prignano vincepri@vmware.com
What this PR does / why we need it:
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #