Skip to content

Commit 0bf7196

Browse files
committed
chore: add lefthook config
1 parent 3d3f524 commit 0bf7196

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: build test test-unit e2e lint install clean
1+
.PHONY: build test test-unit e2e lint install clean tools hooks
22

33
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
44
LDFLAGS := -ldflags "-X github.com/boneskull/gh-stack/cmd.version=$(VERSION)"
@@ -37,3 +37,8 @@ gh-install: build
3737
# Install development tools
3838
tools:
3939
go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.8.0
40+
go install github.com/evilmartians/lefthook/v2@latest
41+
42+
# Install git hooks via lefthook
43+
hooks:
44+
lefthook install

lefthook.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# https://github.com/evilmartians/lefthook
2+
3+
pre-commit:
4+
parallel: true
5+
jobs:
6+
- name: lint
7+
glob: '*.go'
8+
run: golangci-lint run --new-from-rev=HEAD~ ./...

0 commit comments

Comments
 (0)