Skip to content

Use a better way of pinning the version of golangci-lint #4733

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 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ jobs:
- name: Lint
uses: golangci/golangci-lint-action@v8
with:
# If you change this, make sure to also update scripts/golangci-lint-shim.sh
version: v2.2.1
- name: errors
run: golangci-lint run
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ coverage.txt
.idea/

# Binaries
.bin/
lazygit
lazygit.exe

Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
},
"go.alternateTools": {
"golangci-lint-v2": "${workspaceFolder}/.bin/golangci-lint",
"golangci-lint-v2": "${workspaceFolder}/scripts/golangci-lint-shim.sh",
},
"go.lintTool": "golangci-lint-v2",
}
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ format:

.PHONY: lint
lint:
./scripts/lint.sh
./scripts/golangci-lint-shim.sh run

# For more details about integration test, see https://github.com/jesseduffield/lazygit/blob/master/pkg/integration/README.md.
.PHONY: integration-test-tui
Expand Down
8 changes: 8 additions & 0 deletions scripts/golangci-lint-shim.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh

set -e

# Must be kept in sync with the version in .github/workflows/ci.yml
version="v2.2.1"

go run "github.com/golangci/golangci-lint/v2/cmd/golangci-lint@$version" "$@"
12 changes: 0 additions & 12 deletions scripts/lint.sh

This file was deleted.