New and improved linting capabilities.

This commit is contained in:
Sacha Ligthert 2025-03-05 11:55:28 +01:00
parent 76b6150a1e
commit feced4cd7f
2 changed files with 28 additions and 6 deletions

View File

@ -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

View File

@ -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:
cmds:
- pre-commit autoupdate
- pre-commit run --all
silent: true
gource:
cmds:
- gource --auto-skip-seconds 1 --key -r 60
silent: true