Skip to content

Commit 7ebf5ff

Browse files
committed
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.
1 parent 4439531 commit 7ebf5ff

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ format:
4040

4141
.PHONY: lint
4242
lint:
43-
golangci-lint run
43+
./scripts/lint.sh
4444

4545
# For more details about integration test, see https://github.com/jesseduffield/lazygit/blob/master/pkg/integration/README.md.
4646
.PHONY: integration-test-tui

scripts/lint.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/sh
2+
3+
set -e
4+
5+
if [ ! -x ./.bin/golangci-lint ]; then
6+
echo 'You need to install golangci-lint into .bin'
7+
echo 'One way to do this is to run'
8+
echo ' GOBIN=$(pwd)/.bin go install github.com/golangci/golangci-lint/v2/cmd/[email protected]'
9+
exit 1
10+
fi
11+
12+
./.bin/golangci-lint run

0 commit comments

Comments
 (0)