aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-x.githooks/pre-commit13
-rw-r--r--Taskfile.yml33
-rw-r--r--go.mod1
3 files changed, 33 insertions, 14 deletions
diff --git a/.githooks/pre-commit b/.githooks/pre-commit
deleted file mode 100755
index fee14e8..0000000
--- a/.githooks/pre-commit
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/sh
-set -ev
-
-gofmt -d -e -s .
-go vet ./...
-go tool cvet ./...
-go tool gosec -quiet ./...
-go tool gocyclo -over 10 -ignore '.*_templ\.go' .
-go tool golangci-lint run
-go tool govulncheck ./...
-go tool revive
-go test -race ./...
-go mod tidy
diff --git a/Taskfile.yml b/Taskfile.yml
new file mode 100644
index 0000000..0ba1f5f
--- /dev/null
+++ b/Taskfile.yml
@@ -0,0 +1,33 @@
+# https://taskfile.dev
+version: '3'
+
+tasks:
+ templates:
+ cmds:
+ - go tool templ generate
+
+ check:
+ cmds:
+ - gofmt -d -e -s .
+ - go vet ./...
+ - go tool staticcheck ./...
+ - go tool gosec -quiet ./...
+ - go tool golangci-lint run
+ - go tool govulncheck
+ - go test -race ./...
+ - go tool revive
+ - go mod tidy
+
+ tools:
+ cmds:
+ - go get -tool github.com/a-h/templ/cmd/templ
+ - go get -tool github.com/amacneil/dbmate
+ - go get -tool github.com/golangci/golangci-lint/v2/cmd/golangci-lint
+ - go get -tool github.com/securego/gosec/v2/cmd/gosec
+ - go get -tool golang.org/x/vuln/cmd/govulncheck
+ - go get -tool honnef.co/go/tools/cmd/staticcheck
+
+ test:
+ cmds:
+ - go test -v -cover -coverprofile=coverage.out ./...
+ - go tool cover -html=coverage.out \ No newline at end of file
diff --git a/go.mod b/go.mod
index aa667bd..2833f88 100644
--- a/go.mod
+++ b/go.mod
@@ -248,7 +248,6 @@ require (
)
tool (
- github.com/fzipp/gocyclo/cmd/gocyclo
github.com/golangci/golangci-lint/cmd/golangci-lint
github.com/martinlehoux/kagamigo/cmd/cvet
github.com/mgechev/revive