diff --git a/.githooks/pre-commit b/.githooks/pre-commit
new file mode 100644
index 0000000..2d90586
--- /dev/null
+++ b/.githooks/pre-commit
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+set -e -o pipefail
+
+# https://github.com/koalaman/shellcheck/wiki/SC2039#redirect-both-stdout-and-stderr
+if ! command -v golangci-lint 2>&1 /dev/null; then
+ echo "golangci-lint is not installed"
+ exit 1
+fi
+
+exec golangci-lint --build-tags=race run "$@"
diff --git a/.golangci.yml b/.golangci.yml
index 6dc489c..c8c857c 100755
--- a/.golangci.yml
+++ b/.golangci.yml
@@ -2,21 +2,11 @@
run:
timeout: 1m
- skip-dirs:
- - .github
- - .git
allow-parallel-runners: true
-output:
- format: colored-line-number # colored-line-number|line-number|json|tab|checkstyle|code-climate
-
linters-settings:
wsl:
allow-assign-and-anything: true
- govet:
- check-shadowing: true
- golint:
- min-confidence: 0.1
godot:
scope: declarations
capital: true
@@ -34,7 +24,6 @@ linters-settings:
range-loops: true
for-loops: true
nolintlint:
- allow-leading-space: false
require-specific: true
linters: # All available linters list:
@@ -74,6 +63,9 @@ linters: # All available linters list: