Skip to content

ci: migrate golangci-lint config to v2 format and enforce linting#346

Open
Devesanoff wants to merge 1 commit into
meshery-extensions:masterfrom
Devesanoff:fix/migrate-lint-v2
Open

ci: migrate golangci-lint config to v2 format and enforce linting#346
Devesanoff wants to merge 1 commit into
meshery-extensions:masterfrom
Devesanoff:fix/migrate-lint-v2

Conversation

@Devesanoff

Copy link
Copy Markdown

Description

This PR migrates the .golangci.yml configuration to version 2, aligning it with the latest golangci-lint standards. It also updates the CI workflow in build-and-release.yml to include a dedicated lint job, ensuring the build process is protected by code quality checks.

Notes for Reviewers

  • Updated .golangci.yml to version: 2.
  • Added a new lint job to the GitHub Actions workflow.
  • Set the build job to depend on the lint job (needs: [lint]).
  • Verified that the DCO (Developer Certificate of Origin) is signed.
  • Standardized the staticcheck settings to allow lowercase error messages (standard for Meshery).

Signed commits

  • Yes, I signed my commits.

Signed-off-by: Devesanoff <esanovmadaminjon@gmail.com>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

workflow currently uses actions/checkout@v3 across all of it's use cases. they need to be updated to checkout@v6.

steps:
- name: Check out code
uses: actions/checkout@v3
- name: golangci-lint

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

go version being used for the linter needs to be setup

name: Build check
runs-on: ubuntu-latest
# needs: [lint, error_check, static_check, vet, sec_check, tests]
needs: [lint]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

keep comment but remove lint from comment

Comment thread .golangci.yml

run:
timeout: 5m
skip-dirs:

@banana-three-join banana-three-join Apr 29, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

skip-dirs is deprecated. utilize exclude-dirs instead.

Comment thread .golangci.yml

@banana-three-join banana-three-join Apr 29, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Rules and comments shouldn't be discarded in order to migrate to the new golangci-lint version. The rules still hold even through the version change, they need to be rewritten instead of being just removed.

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.

2 participants