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

Fix warnings in golangci linter #1085

Closed
wants to merge 12 commits into from

Conversation

joeyyy09
Copy link
Contributor

@joeyyy09 joeyyy09 commented May 17, 2024

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

This PR updates the .golangci.yaml file to address the following warnings:

  • Deprecated configuration options linters.staticcheck.go and linters.stylecheck.go are replaced with global run.go.
  • Moved exclude files configuration from the deprecated run.skip-files to issues.exclude-files.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

None

Does this PR introduce a user-facing change?

NONE

@k8s-ci-robot k8s-ci-robot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels May 17, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: joeyyy09
Once this PR has been reviewed and has the lgtm label, please assign yibozhuang for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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 the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label May 17, 2024
@k8s-ci-robot
Copy link
Contributor

Hi @joeyyy09. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label May 17, 2024
Copy link

netlify bot commented May 17, 2024

Deploy Preview for k8s-kwok canceled.

Name Link
🔨 Latest commit 005d03f
🔍 Latest deploy log https://app.netlify.com/sites/k8s-kwok/deploys/6656d63a324f9b00082c267c

@wzshiming
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels May 17, 2024
.golangci.yaml Outdated
Comment on lines 30 to 31
- staticcheck
- stylecheck
Copy link
Member

Choose a reason for hiding this comment

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

Why turn off the check, it works fine.

Copy link
Contributor Author

@joeyyy09 joeyyy09 May 17, 2024

Choose a reason for hiding this comment

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

i didnt turn off the check, static check and style check are deprecated and it's covered under the global run.go in the later versions so they're performing the actions under the global run.go as per the docs i've see., PFA the image where the warnings and the logs are shown. I've made the changes according to the logs itself. Let me know if i've got to change this

image

Comment on lines 17 to 19
uses: golangci/golangci-lint-action@v3
with:
version: v1.55.2
Copy link
Member

Choose a reason for hiding this comment

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

All checks are version dependent, the current version of lint has no warnings in CI, you should upgrade this version and fix the warnings.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

All checks are version dependent, the current version of lint has no warnings in CI, you should upgrade this version and fix the warnings.

Okay, will look into this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've bumped up the version to 1.58 as per your suggestion in the new commit

@@ -17,4 +17,4 @@ jobs:
uses: golangci/golangci-lint-action@v3
with:
version: v1.55.2
Copy link
Member

Choose a reason for hiding this comment

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

.github/workflows/golangci-lint.yaml Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. release-note-none Denotes a PR that doesn't merit a release note. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels May 21, 2024
@joeyyy09
Copy link
Contributor Author

@wzshiming I've fixed all the warnings and errors. Can you please have a look at them?

@wzshiming
Copy link
Member

.golangci.yaml Outdated Show resolved Hide resolved
.golangci.yaml Outdated Show resolved Hide resolved
Copy link
Member

@wzshiming wzshiming left a comment

Choose a reason for hiding this comment

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

Squash commits and rebase to main

joeyyy09 and others added 7 commits May 29, 2024 12:41
Signed-off-by: Joeyyy09 <imt_2021063@iiitm.ac.in>

Bump golangci version to the latest version

Signed-off-by: Joeyyy09 <imt_2021063@iiitm.ac.in>

Bump golangci version to the latest version

Signed-off-by: Joeyyy09 <imt_2021063@iiitm.ac.in>

Bump golangci version to the latest version

Signed-off-by: Joeyyy09 <imt_2021063@iiitm.ac.in>

Change golangci-lint  version to v1.55.2

Signed-off-by: Joeyyy09 <imt_2021063@iiitm.ac.in>
network-charles and others added 5 commits May 29, 2024 12:41
* Add Test Cases for slices package

Signed-off-by: Joeyyy09 <imt_2021063@iiitm.ac.in>

* Fix linting issues

Signed-off-by: Joeyyy09 <imt_2021063@iiitm.ac.in>

* Fix linting issues

Signed-off-by: Joeyyy09 <imt_2021063@iiitm.ac.in>

---------

Signed-off-by: Joeyyy09 <imt_2021063@iiitm.ac.in>
Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 3 to 6.
- [Release notes](https://github.com/golangci/golangci-lint-action/releases)
- [Commits](golangci/golangci-lint-action@v3...v6)

---
updated-dependencies:
- dependency-name: golangci/golangci-lint-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Joeyyy09 <imt_2021063@iiitm.ac.in>

Made faulty reader a field to be more generic

Signed-off-by: Joeyyy09 <imt_2021063@iiitm.ac.in>
Fix warnings in golangci linter

Signed-off-by: Joeyyy09 <imt_2021063@iiitm.ac.in>

Update .golangci.yaml

Co-authored-by: Shiming Zhang <wzshiming@hotmail.com>

Fix issues

Signed-off-by: Joeyyy09 <imt_2021063@iiitm.ac.in>
@k8s-ci-robot k8s-ci-robot added the kind/documentation Categorizes issue or PR as related to documentation. label May 29, 2024
@k8s-ci-robot
Copy link
Contributor

PR needs rebase.

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.

@k8s-ci-robot k8s-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels May 29, 2024
@k8s-ci-robot
Copy link
Contributor

@joeyyy09: The following tests 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-kwok-build-main 005d03f link true /test pull-kwok-build-main
pull-kwok-e2e-test-main 005d03f link true /test pull-kwok-e2e-test-main
pull-kwok-unit-test-main 005d03f link true /test pull-kwok-unit-test-main
pull-kwok-verify-main 005d03f link true /test pull-kwok-verify-main

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.

@joeyyy09 joeyyy09 closed this May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. kind/documentation Categorizes issue or PR as related to documentation. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants