diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 03c43d4119d..6e7b5fd5825 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -5,8 +5,6 @@ ARG VARIANT=1-bullseye FROM golang:${VARIANT} RUN go install mvdan.cc/gofumpt@latest -RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.50.0 -RUN golangci-lint --version # [Optional] Uncomment this section to install additional OS packages. # RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6b6cbcd52ca..7f431fca9e6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/.gitignore b/.gitignore index e9c93214f5b..6d9b25784d4 100644 --- a/.gitignore +++ b/.gitignore @@ -14,7 +14,6 @@ coverage.txt .idea/ # Binaries -.bin/ lazygit lazygit.exe diff --git a/.vscode/settings.json b/.vscode/settings.json index 23a0e524bb6..dd4398af90b 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -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", } diff --git a/Makefile b/Makefile index f972100a143..38dc118cb82 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/scripts/golangci-lint-shim.sh b/scripts/golangci-lint-shim.sh new file mode 100755 index 00000000000..24e32ac8580 --- /dev/null +++ b/scripts/golangci-lint-shim.sh @@ -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" "$@" diff --git a/scripts/lint.sh b/scripts/lint.sh deleted file mode 100755 index 98d697bc100..00000000000 --- a/scripts/lint.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -set -e - -if [ ! -x ./.bin/golangci-lint ]; then - echo 'You need to install golangci-lint into .bin' - echo 'One way to do this is to run' - echo ' GOBIN=$(pwd)/.bin go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.2.1' - exit 1 -fi - -./.bin/golangci-lint run