@@ -1,8 +1,18 @@
+# See https://pre-commit.com for more information
+# See https://pre-commit.com/hooks.html for more hooks
repos:
- - repo: https://github.com/pre-commit/pre-commit-hooks
- rev: v4.6.0 # this is optional, use `pre-commit autoupdate` to get the latest rev!
+- repo: https://github.com/pre-commit/pre-commit-hooks
+ rev: v5.0.0
hooks:
- - id: check-yaml
- - id: end-of-file-fixer
- - id: trailing-whitespace
-
+ - id: trailing-whitespace
+ - id: end-of-file-fixer
+ - id: check-yaml
+ - id: check-added-large-files
+- repo: https://github.com/dnephin/pre-commit-golang
+ rev: v0.5.1
+ hooks:
+ - id: go-fmt
+ - id: go-imports
+ - id: no-go-testing
+ - id: golangci-lint
+ - id: go-unit-tests
@@ -14,3 +14,15 @@ tasks:
- rm {{.BUILD_DIR}}/* || true
- go tool dist list | grep -v android | grep -v ios | grep -v wasip1 | awk -F '/' '{printf "echo Compiling %s/%s; env CGO_ENABLED=1 GOOS=%s GOARCH=%s go build -o {{.BUILD_DIR}}/{{.APP}}.%s-%s\n",$1,$2,$1,$2,$1,$2 }' | sh
- for i in `ls {{.BUILD_DIR}}/*windows*`; do mv -v $i $i.exe; done
+ lint:
+ cmds:
+ - golangci-lint run
+ precommit:
+ - pre-commit autoupdate
+ - pre-commit run --all
+ silent: true
+ gource:
+ - gource --auto-skip-seconds 1 --key -r 60