Skip to content

fix: migrate to golangci-lint v2#779

Merged
massongit merged 4 commits intoreviewdog:masterfrom
pranc1ngpegasus:fix/migrate-to-golangci-lint-v2
Mar 25, 2025
Merged

fix: migrate to golangci-lint v2#779
massongit merged 4 commits intoreviewdog:masterfrom
pranc1ngpegasus:fix/migrate-to-golangci-lint-v2

Conversation

@pranc1ngpegasus
Copy link
Copy Markdown
Contributor

@pranc1ngpegasus pranc1ngpegasus commented Mar 24, 2025

golangci-lint has released v2. And some command line options has deprecated.
In this PR, migrate command line options to v2. And switch them between v1 and v2.

v1

golangci-lint run --out-format line-number

v2

golangci-lint run --output.text.path stdout
ref: https://golangci-lint.run/product/migration-guide/#outputformatsformat-line-number

@billinghamj
Copy link
Copy Markdown

Hey :) We're looking at mitigating this internally. Just before we do, I thought worth asking - is this likely to be merged in minutes/couple hours, or more like several hours/days?

Not looking to pressure, all good if it'll take some time! 😄

@pranc1ngpegasus
Copy link
Copy Markdown
Contributor Author

pranc1ngpegasus commented Mar 24, 2025

@billinghamj
At this time, I believe you can solve this issue with following code.

uses: reviewdog/action-golangci-lint@v2
with:
  golangci_lint_version: 1.64.8 # pin golangci-lint version

@billinghamj
Copy link
Copy Markdown

Yeah that's our mitigation :) We usually just prefer not to pin as it's easy to forget about it

Will go with that for now

@rsdmike
Copy link
Copy Markdown

rsdmike commented Mar 24, 2025

For me I needed the "v" otherwise got a not found:

- name: golangci-lint
   uses: reviewdog/action-golangci-lint@3dfdce20f5ca12d264c214abb993dbb40834da90 # v2.7.2
   with:
     fail_level: error
     golangci_lint_version: v1.64.8 # pin golangci-lint version
     golangci_lint_flags: "--config=.github/.golangci.yml ./..."

@pranc1ngpegasus pranc1ngpegasus force-pushed the fix/migrate-to-golangci-lint-v2 branch 2 times, most recently from d89cbd7 to e90c183 Compare March 24, 2025 21:56
@pranc1ngpegasus pranc1ngpegasus force-pushed the fix/migrate-to-golangci-lint-v2 branch 6 times, most recently from 1f18463 to 167dd74 Compare March 24, 2025 23:11
Copy link
Copy Markdown
Contributor

@massongit massongit left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines -119 to -132
golint:
name: runner / golint
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: golint
uses: ./
with:
github_token: ${{ secrets.github_token }}
golangci_lint_flags: "--disable-all -E golint ./testdata"
tool_name: golint
level: warning

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Comment on lines +18 to +23
exclusions:
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

check-blank: false

linters:
default: none
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@massongit massongit merged commit f9bba13 into reviewdog:master Mar 25, 2025
25 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

🚀 [bumpr] Bumped! New version:v2.8.0 Changes:v2.7.2...v2.8.0

@massongit massongit mentioned this pull request Mar 25, 2025
@pranc1ngpegasus pranc1ngpegasus deleted the fix/migrate-to-golangci-lint-v2 branch March 26, 2025 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI Workflow started to fail

4 participants