Skip to content
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

🌱 Add lint-config target to validate config and fix issues faced #4458

Merged

Conversation

camilamacedo86
Copy link
Member

@camilamacedo86 camilamacedo86 commented Jan 1, 2025

Fix golangci-lint config schema errors: corrected invalid govet fieldalignment

This PR add the new target, which is also called in the CI to validate the Lint config for Kubebuilder itself and solve the issues found:

make lint-config
/Users/camilam/go/src/sigs.k8s.io/kubebuilder/bin/golangci-lint config verify
jsonschema: "linters-settings.revive.rules.3.arguments" does not validate with "/properties/linters-settings/properties/revive/properties/rules/items/properties/arguments/type": expected array, but got object
jsonschema: "linters-settings.govet" does not validate with "/properties/linters-settings/properties/govet/additionalProperties": additionalProperties 'enable=fieldalignment' not allowed
Failed executing command with error: the configuration contains invalid elements
make: *** [lint-config] Error 3

Related to: #4416

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jan 1, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: camilamacedo86

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jan 1, 2025
.golangci.yml Outdated
@@ -76,6 +74,7 @@ linters:
- goimports
- gosimple
- govet
- fieldalignment
- ineffassign
- lll
- misspell
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mateusoliveira43

See the fix required.

@camilamacedo86 camilamacedo86 force-pushed the add-lint-config-kb branch 2 times, most recently from 30f2e93 to 45b89e7 Compare January 1, 2025 09:16
Fix golangci-lint config schema errors: corrected invalid govet fieldalignment

Co-Author: Mateus Oliveira <msouzaol@redhat.com>
@k8s-ci-robot
Copy link
Contributor

@camilamacedo86: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-kubebuilder-e2e-k8s-1-32-0 cd504d3 link true /test pull-kubebuilder-e2e-k8s-1-32-0

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@camilamacedo86
Copy link
Member Author

Just add the linter check for kubebuilder itself.

@camilamacedo86 camilamacedo86 merged commit 06b67eb into kubernetes-sigs:master Jan 1, 2025
14 of 19 checks passed
@camilamacedo86 camilamacedo86 deleted the add-lint-config-kb branch January 1, 2025 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants