From 7ebf5fff0f637d375a6ccb27f5f3e73ce291aa75 Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Mon, 30 Jun 2025 14:13:03 +0200 Subject: [PATCH] Provide a script to lint the whole working copy, and update make lint to use it The script expects a golangci-lint binary in .bin; this makes it possible to install the exact same version that also runs on CI. --- Makefile | 2 +- scripts/lint.sh | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100755 scripts/lint.sh diff --git a/Makefile b/Makefile index ca490a94a..f972100a1 100644 --- a/Makefile +++ b/Makefile @@ -40,7 +40,7 @@ format: .PHONY: lint lint: - golangci-lint run + ./scripts/lint.sh # 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/lint.sh b/scripts/lint.sh new file mode 100755 index 000000000..98d697bc1 --- /dev/null +++ b/scripts/lint.sh @@ -0,0 +1,12 @@ +#!/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