8000 chore: Bump golangci-lint to v2 by mrueg · Pull Request #2083 · urfave/cli · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

chore: Bump golangci-lint to v2 #2083

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

Merged
merged 3 commits into from
Apr 2, 2025
Merged

Conversation

mrueg
Copy link
Contributor
@mrueg mrueg commented Mar 31, 2025

What type of PR is this?

  • cleanup

What this PR does / why we need it:

Bumps to golangci-lint v2.

Which issue(s) this PR fixes:

None

Special notes for your reviewer:

(fill-in or delete this section)

Testing

(fill-in or delete this section)

Release Notes

(REQUIRED)

NONE

@mrueg mrueg requested a review from a team as a code owner March 31, 2025 16:52
@mrueg mrueg force-pushed the bump-golangci-lint branch from b6c9093 to 7a86e4d Compare March 31, 2025 17:05
@mrueg mrueg force-pushed the bump-golangci-lint branch from 7a86e4d to 0aa0c60 Compare March 31, 2025 17:08
Comment on lines 37 to 53
staticcheck:
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: stable

- name: Clone repository
uses: actions/checkout@v4

- name: Set up staticcheck
run: go install honnef.co/go/tools/cmd/staticcheck@latest

- name: Run staticcheck
run: staticcheck ./...

Copy link
Member

Choose a reason for hiding this comment

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

Why remove it? Does new golang-ci-lint v2 include staticcheck?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Just FYI, the staticcheck linter in Golangci-lint V1 is not the same as the standalone Staticcheck linter. The V1 docs included an additional statement that says (golangci/golangci-lint#2894):

It's not the same thing as the staticcheck binary. The author of staticcheck doesn't support or approve the use of staticcheck as a library inside golangci-lint.

This statement has been removed in V2.

In V1, stylecheck, gosimple, and staticcheck cover the 4 options of the standalone Staticcheck linter. They have been merged in golangci/golangci-lint#5487, that means the staticcheck in Golangci-lint V2 now actually works like the standalone Staticcheck linter.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks for the context!

I think with v2 we should be safe unless I'm missing something?

.golangci.yaml Outdated
Comment on lines 6 to 23
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
paths:
- third_party$
- builtin$
- examples$
formatters:
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$
Copy link
Member

Choose a reason for hiding this comment

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

Did you copy this config from somewhere else? Because we only have the examples directory https://github.com/urfave/cli/tree/main/examples

Since our examples code are minimal, I think we should be able to include them in the linter too and not cause any errors. What do you think?

Copy link
Contributor Author
@mrueg mrueg Apr 1, 2025

Choose a reason for hiding this comment

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

This was auto-generated by golangci-lint migrate. I think right now it passes lint, so we can keep it like that.

Juneezee added 2 commits April 2, 2025 09:57
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
`actions/setup-go` uses `go.sum` file as the cache key. The CI needs to
clone the repository first in order to restore the cache properly.

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
Comment on lines +20 to -27
- name: Clone repository
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: stable

- name: Clone repository
uses: actions/checkout@v4

Copy link
Member

Choose a reason for hiding this comment

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

2025-04-02_10-05

This fixes that the CI cache isn't getting used because of the order of our clone and Go setup.

@Juneezee Juneezee merged commit 362a914 into urfave:main Apr 2, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0