Skip to content

Updates linter version and args in Makefile #9196

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

theobarberbany
Copy link
Contributor

@theobarberbany theobarberbany commented Jun 19, 2025

What type of PR is this?

/kind cleanup
/kind failing-test

What this PR does / why we need it:

This change:

  • Updates the linter version defined in the Makefile to match what is being run on github actions (1.60.1 -> 1.64.8). Anyone using the makefile (e.g in a fork) is facing issues because of this :(

    This means the linter is compiled with go 1.24, rather than 1.23, fixing typing issues.

  • Removes the flag enabling exportloopref, which is deprecated as of go 1.22

Which issue(s) this PR fixes:

Anyone running make lint locally or in a fork.

Special notes for your reviewer:

Does this PR introduce a user-facing change?

NONE

This change:

- Updates the linter version defined in the Makefile to match what is
being run on github actions (1.60.1 -> 1.64.8).

This means the linter is compiled with go 1.24, rather than 1.23, fixing
typing issues.

- Removes the flag enabling exportloopref, which is deprecated as of go
  1.22
@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. kind/failing-test Categorizes issue or PR as related to a consistently or frequently failing test. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jun 19, 2025
@k8s-ci-robot k8s-ci-robot requested review from mainred and nilo19 June 19, 2025 11:19
@github-actions github-actions bot added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label Jun 19, 2025
@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jun 19, 2025
@mdbooth
Copy link

mdbooth commented Jun 19, 2025

/ok-to-test

@k8s-ci-robot k8s-ci-robot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Jun 19, 2025
@mdbooth
Copy link

mdbooth commented Jun 19, 2025

@theobarberbany This doesn't fix make lint for me locally, btw. Is any CI job running that?

@theobarberbany
Copy link
Contributor Author

theobarberbany commented Jun 19, 2025

In my local testing, this appears to work?
Have you cleaned /bin?

cloud-provider-azure on  cherrypick-lint-fix [$] via 🐳 colima via 🐹 v1.24.3 on ☁️  tbarberb@redhat.com(us-east1)
❯ gco sigs/master
Updating files: 100% (18942/18942), done.
Note: switching to 'sigs/master'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at c9cb91689 chore: fix release pipeline (#9193)

cloud-provider-azure on  HEAD (c9cb916) [$] via 🐳 colima via 🐹 v1.24.3 on ☁️  tbarberb@redhat.com(us-east1)
❯ g cherry-pick 3e90ec304a1f704d600eea737835636233a8cf5c
[detached HEAD a6f2cb73f] Updates linter version and args in Makefile
 Date: Thu Jun 19 12:12:41 2025 +0100
 1 file changed, 2 insertions(+), 2 deletions(-)

cloud-provider-azure on  HEAD (a6f2cb7) [$] via 🐳 colima via 🐹 v1.24.3 on ☁️  tbarberb@redhat.com(us-east1)
❯ make lint
Installing golangci-lint
/Users/tbarberb/projects/cloud-provider-azure/bin/golangci-lint run -v
INFO golangci-lint has version 1.64.8 built with go1.24.1 from 8b37f141 on 2025-03-17T20:41:53Z
INFO [config_reader] Config search paths: [./ /Users/tbarberb/projects/cloud-provider-azure /Users/tbarberb/projects /Users/tbarberb /Users /]
INFO [config_reader] Used config file .golangci.yml
INFO [goenv] Read go env for 9.544125ms: map[string]string{"GOCACHE":"/Users/tbarberb/Library/Caches/go-build", "GOROOT":"/opt/homebrew/opt/go/libexec"}
INFO [lintersdb] Active 18 linters: [asasalint asciicheck bidichk errcheck errorlint goconst goimports gosec gosimple govet ineffassign loggercheck misspell nakedret revive staticcheck unconvert unused]
INFO [loader] Go packages loading at mode 8767 (deps|files|imports|name|exports_file|types_sizes|compiled_files) took 1.808413s
INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 49.492083ms
INFO [linters_context/goanalysis] analyzers took 0s with no stages
INFO [runner/exclusion_rules] Skipped 0 issues by rules: [Path: "tests/e2e", Linters: "revive"]
INFO [runner] Issues before processing: 335, after processing: 0
INFO [runner] Processors filtering stat (in/out): exclusion_paths: 335/335, skip_dirs: 335/335, identifier_marker: 332/332, cgo: 335/335, filename_unadjuster: 335/335, invalid_issue: 335/335, path_relativity: 335/335, skip_files: 335/335, exclusion_rules: 332/6, path_absoluter: 335/335, generated_file_filter: 335/332, nolint_filter: 6/0
INFO [runner] processing took 12.048289ms with stages: nolint_filter: 5.574958ms, generated_file_filter: 4.063333ms, exclusion_rules: 1.594ms, skip_dirs: 475.958µs, path_relativity: 260.792µs, identifier_marker: 35.166µs, invalid_issue: 12.541µs, path_absoluter: 12.501µs, cgo: 10.124µs, filename_unadjuster: 5.458µs, max_same_issues: 1.166µs, exclusion_paths: 625ns, fixer: 376ns, path_shortener: 251ns, diff: 167ns, max_from_linter: 167ns, uniq_by_line: 167ns, sort_results: 166ns, source_code: 124ns, path_prettifier: 83ns, severity-rules: 83ns, max_per_file_from_linter: 42ns, skip_files: 41ns
INFO [runner] linters took 2.603255542s with stages: goanalysis_metalinter: 2.591141041s
INFO File cache stats: 0 entries of total size 0B
INFO Memory: 46 samples, avg is 67.9MB, max is 92.4MB
INFO Execution took 4.471433792s

cloud-provider-azure on  HEAD (a6f2cb7) [$] via 🐳 colima via 🐹 v1.24.3 on ☁️  tbarberb@redhat.com(us-east1) took 4s
❯

@mdbooth
Copy link

mdbooth commented Jun 19, 2025

In my local testing, this appears to work? Have you cleaned /bin?

Yeah, that fixed it. Incidentally the latest kubebuilder scaffolding has a pattern which doesn't suffer from this. e.g. https://github.com/k-orc/openstack-resource-controller/blob/0d339b3062ceeaa01cf21258a3d8eb7442f8b1bd/Makefile#L328C1-L332C1

@damdo
Copy link
Member

damdo commented Jun 20, 2025

/assign @feiskyer @MartinForReal

@damdo
Copy link
Member

damdo commented Jun 20, 2025

@mdbooth that would be nice yes, in the interest of fixing this we could merge this and if someone has bandwidth to follow up with a change along those lines, that might be welcome?

@nilo19
Copy link
Contributor

nilo19 commented Jun 20, 2025

make lint works for me locally, my go version is 1.24.2.

@MartinForReal
Copy link
Contributor

@MartinForReal
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 23, 2025
@damdo
Copy link
Member

damdo commented Jun 23, 2025

Thanks @nilo19 would you be able to approve if you're happy then?

@nilo19
Copy link
Contributor

nilo19 commented Jun 23, 2025

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: nilo19, theobarberbany

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 the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 23, 2025
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. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. kind/failing-test Categorizes issue or PR as related to a consistently or frequently failing test. lgtm "Looks good to me", indicates that a PR is ready to be merged. 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/XS Denotes a PR that changes 0-9 lines, ignoring generated files. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants