Skip to content

Commit 749924b

Browse files
committedAug 20, 2019
Add lefthook
1 parent 337bb38 commit 749924b

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed
 

‎.lefthook/pre-commit/lint

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/sh
2+
3+
if ! [ -x "$(which brew)" ]; then
4+
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$(brew --prefix libffi)/lib/pkgconfig"
5+
fi
6+
7+
export CGO_LDFLAGS_ALLOW="-s|-w"
8+
export CGO_CFLAGS_ALLOW="-Xpreprocessor"
9+
10+
golangci-lint run

‎.lefthook/pre-push/test

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/sh
2+
3+
if ! [ -x "$(which brew)" ]; then
4+
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$(brew --prefix libffi)/lib/pkgconfig"
5+
fi
6+
7+
export CGO_LDFLAGS_ALLOW="-s|-w"
8+
export CGO_CFLAGS_ALLOW="-Xpreprocessor"
9+
10+
go test

‎lefthook.yml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
pre-commit:
2+
scripts:
3+
lint:
4+
tags: lint
5+
6+
pre-push:
7+
scripts:
8+
test:
9+
tags: test

0 commit comments

Comments
 (0)
Please sign in to comment.