Files
sogcli/Taskfile.yml

90 lines
1.8 KiB
YAML

version: '3'
vars:
BINARY: sog
MAIN: ./cmd/sog
tasks:
default:
desc: Show available tasks
cmds:
- task --list
build:
desc: Build the binary
cmds:
- go build -o {{.BINARY}} {{.MAIN}}
install:
desc: Install to $GOPATH/bin
cmds:
- go install {{.MAIN}}
fmt:
desc: Format code
cmds:
- gofmt -s -w .
- goimports -w .
lint:
desc: Run linters
cmds:
- go vet ./...
- staticcheck ./... || true
test:
desc: Run tests
cmds:
- go test -v ./...
test:coverage:
desc: Run unit tests with coverage
cmds:
- go test -coverprofile=coverage.out ./...
- go tool cover -func=coverage.out
- go tool cover -html=coverage.out -o coverage.html
test:integration:
desc: Run integration tests (requires GreenMail)
cmds:
- go test -tags=integration -v ./...
test:all:
desc: Run all tests with coverage (target ≥85%)
cmds:
- go test -tags=integration -coverprofile=coverage.out ./...
- go tool cover -func=coverage.out
- go tool cover -html=coverage.out -o coverage.html
quality:
desc: Run all quality checks
cmds:
- task: fmt
- task: lint
- task: test
check:
desc: Pre-commit checks (fmt + lint + test)
cmds:
- task: quality
clean:
desc: Clean build artifacts
cmds:
- rm -f {{.BINARY}} coverage.out coverage.html
deps:
desc: Download and tidy dependencies
cmds:
- go mod download
- go mod tidy
completions:
desc: Generate shell completions
cmds:
- mkdir -p completions
- ./sog --help-man > completions/sog.1 2>/dev/null || true
- echo "# Bash: source completions/sog.bash"
- echo "# Zsh: source completions/sog.zsh"
- echo "# Fish: source completions/sog.fish"