diff --git a/Taskfile.yml b/Taskfile.yml index e6f0fce..92c3bd1 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -9,34 +9,58 @@ tasks: default: desc: List all available tasks silent: true - cmd: task --list + cmds: + - task --list tidy: desc: Tidy dependencies in go.mod and go.sum - cmd: go mod tidy + sources: + - "**/*.go" + - go.mod + - go.sum + cmds: + - go mod tidy fmt: desc: Run go fmt on all source files - cmd: go fmt ./... + sources: + - "**/*.go" + preconditions: + - sh: command -v golines + msg: golines not installed, see https://github.com/segmentio/golines + cmds: + - go fmt ./... + - golines . --ignore-generated --write-output test: desc: Run the test suite - cmd: go test -race ./... {{ .CLI_ARGS }} + sources: + - "**/*.go" + cmds: + - go test -race ./... {{ .CLI_ARGS }} bench: desc: Run all project benchmarks - cmd: go test ./... -run None -benchmem -bench . {{ .CLI_ARGS }} + sources: + - "**/*.go" + cmds: + - go test ./... -run None -benchmem -bench . {{ .CLI_ARGS }} lint: desc: Run the linters and auto-fix if possible - cmd: golangci-lint run --fix + sources: + - "**/*.go" + - .golangci.yml + cmds: + - golangci-lint run --fix preconditions: - sh: command -v golangci-lint msg: golangci-lint not installed, see https://golangci-lint.run/usage/install/#local-installation doc: desc: Render the pkg docs locally - cmd: pkgsite -open + cmds: + - pkgsite -open preconditions: - sh: command -v pkgsite msg: pkgsite not installed, run go install golang.org/x/pkgsite/cmd/pkgsite@latest @@ -57,10 +81,17 @@ tasks: sloc: desc: Print lines of code - cmd: fd . -e go | xargs wc -l | sort -nr | head + cmds: + - fd . -e go | xargs wc -l | sort -nr | head clean: desc: Remove build artifacts and other clutter cmds: - go clean ./... - rm -rf {{ .COV_DATA }} + + update: + desc: Updates dependencies in go.mod and go.sum + cmds: + - go get -u ./... + - go mody tidy diff --git a/go.mod b/go.mod index 0859351..04496cd 100644 --- a/go.mod +++ b/go.mod @@ -7,5 +7,5 @@ require github.com/fatih/color v1.17.0 require ( github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect - golang.org/x/sys v0.22.0 // indirect + golang.org/x/sys v0.24.0 // indirect ) diff --git a/go.sum b/go.sum index 95c2873..e04f2c9 100644 --- a/go.sum +++ b/go.sum @@ -7,5 +7,5 @@ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWE github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= -golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg= +golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=