mirror of
https://github.com/foomo/posh-providers.git
synced 2025-10-16 12:35:41 +00:00
chore: add husky
This commit is contained in:
parent
931bd51e54
commit
8187972c14
15
.husky.yaml
Normal file
15
.husky.yaml
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
hooks:
|
||||||
|
pre-commit:
|
||||||
|
- golangci-lint run --fast
|
||||||
|
- husky lint-staged
|
||||||
|
commit-msg:
|
||||||
|
# only execute if not in a merge
|
||||||
|
- if [[ -z $(git rev-parse -q --verify MERGE_HEAD) ]]; then husky lint-commit; fi
|
||||||
|
|
||||||
|
lint-staged:
|
||||||
|
'*.go':
|
||||||
|
- golangci-lint fmt
|
||||||
|
|
||||||
|
lint-commit:
|
||||||
|
types: '^(feat|fix|build|chore|docs|perf|refactor|revert|style|test|wip)$'
|
||||||
|
header: '^(?P<type>\w+)(\((?P<scope>[\w/.-]+)\))?(?P<breaking>!)?:( +)?(?P<header>.+)'
|
||||||
3
.husky/applypatch-msg
Executable file
3
.husky/applypatch-msg
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
husky hook $(basename "$0") $*
|
||||||
3
.husky/commit-msg
Executable file
3
.husky/commit-msg
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
husky hook $(basename "$0") $*
|
||||||
3
.husky/fsmonitor-watchman
Executable file
3
.husky/fsmonitor-watchman
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
husky hook $(basename "$0") $*
|
||||||
3
.husky/post-update
Executable file
3
.husky/post-update
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
husky hook $(basename "$0") $*
|
||||||
3
.husky/pre-applypatch
Executable file
3
.husky/pre-applypatch
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
husky hook $(basename "$0") $*
|
||||||
3
.husky/pre-commit
Executable file
3
.husky/pre-commit
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
husky hook $(basename "$0") $*
|
||||||
3
.husky/pre-merge-commit
Executable file
3
.husky/pre-merge-commit
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
husky hook $(basename "$0") $*
|
||||||
3
.husky/pre-push
Executable file
3
.husky/pre-push
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
husky hook $(basename "$0") $*
|
||||||
3
.husky/pre-rebase
Executable file
3
.husky/pre-rebase
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
husky hook $(basename "$0") $*
|
||||||
3
.husky/pre-receive
Executable file
3
.husky/pre-receive
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
husky hook $(basename "$0") $*
|
||||||
3
.husky/prepare-commit-msg
Executable file
3
.husky/prepare-commit-msg
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
husky hook $(basename "$0") $*
|
||||||
3
.husky/push-to-checkout
Executable file
3
.husky/push-to-checkout
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
husky hook $(basename "$0") $*
|
||||||
3
.husky/sendemail-validate
Executable file
3
.husky/sendemail-validate
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
husky hook $(basename "$0") $*
|
||||||
3
.husky/update
Executable file
3
.husky/update
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
husky hook $(basename "$0") $*
|
||||||
19
Makefile
19
Makefile
@ -1,6 +1,21 @@
|
|||||||
.DEFAULT_GOAL:=help
|
.DEFAULT_GOAL:=help
|
||||||
-include .makerc
|
-include .makerc
|
||||||
|
|
||||||
|
# --- Targets -----------------------------------------------------------------
|
||||||
|
|
||||||
|
# This allows us to accept extra arguments
|
||||||
|
%: .husky
|
||||||
|
@:
|
||||||
|
|
||||||
|
.PHONY: .husky
|
||||||
|
# Configure git hooks for husky
|
||||||
|
.husky:
|
||||||
|
@if ! command -v husky &> /dev/null; then \
|
||||||
|
echo "ERROR: missing executeable 'husky', please run:"; \
|
||||||
|
echo "\n$ go install github.com/go-courier/husky/cmd/husky@latest\n"; \
|
||||||
|
fi
|
||||||
|
@git config core.hooksPath .husky
|
||||||
|
|
||||||
## === Tasks ===
|
## === Tasks ===
|
||||||
|
|
||||||
.PHONY: tidy
|
.PHONY: tidy
|
||||||
@ -63,8 +78,8 @@ outdated:
|
|||||||
.PHONY: test
|
.PHONY: test
|
||||||
## Run tests
|
## Run tests
|
||||||
test:
|
test:
|
||||||
@GO_TEST_TAGS=-skip go test -coverprofile=coverage.out -race ./...
|
@GO_TEST_TAGS=-skip go test -coverprofile=coverage.out --tags=safe -race ./...
|
||||||
#@GO_TEST_TAGS=-skip go test -coverprofile=coverage.out -race -json ./... 2>&1 | tee /tmp/gotest.log | gotestfmt
|
#@GO_TEST_TAGS=-skip go test -coverprofile=coverage.out --tags=safe -race -json ./... 2>&1 | tee /tmp/gotest.log | gotestfmt
|
||||||
|
|
||||||
.PHONY: lint.fix
|
.PHONY: lint.fix
|
||||||
## Fix lint violations
|
## Fix lint violations
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user