Consolidate CLI code into pkg/cli: - Add pkg/cli/app.go with Main() entry point and completionCmd - Move build variants to internal/variants/ (avoids import cycle) - Move i18n-validate tool to internal/tools/ - Update main.go to call cli.Main() - Remove cmd/ directory entirely Structure: - main.go imports internal/variants (triggers command registration) - main.go calls cli.Main() which runs the CLI - Build variants: go build, go build -tags ci/php/minimal Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
62 lines
1.4 KiB
YAML
62 lines
1.4 KiB
YAML
version: '3'
|
|
|
|
tasks:
|
|
cli:build:
|
|
desc: "Build the core CLI executable"
|
|
cmds:
|
|
- go build -o ./bin/core .
|
|
|
|
cli:run:
|
|
desc: "Build and run the core CLI"
|
|
cmds:
|
|
- task: cli:build
|
|
- ./bin/core {{.CLI_ARGS}}
|
|
|
|
|
|
test:
|
|
desc: "Run all Go tests recursively for the entire project."
|
|
cmds:
|
|
- cmd: clear
|
|
platforms: [linux, darwin]
|
|
- cmd: cls
|
|
platforms: [windows]
|
|
- cmd: go test ./...
|
|
|
|
review:
|
|
desc: "Run CodeRabbit review to get feedback on the current changes."
|
|
cmds:
|
|
- coderabbit review --prompt-only
|
|
|
|
check:
|
|
desc: "Run a CodeRabbit review followed by the full test suite."
|
|
cmds:
|
|
- task: go:mod:tidy
|
|
- go test ./... # make sure the code compiles before asking coderabbit to review it
|
|
- task: review
|
|
|
|
go:mod:tidy:
|
|
summary: Runs `go mod tidy`
|
|
internal: true
|
|
cmds:
|
|
- go mod tidy
|
|
|
|
cov:
|
|
desc: "Generate coverage profile (coverage.txt)"
|
|
cmds:
|
|
- go test -coverprofile=coverage.txt ./...
|
|
|
|
cov-view:
|
|
desc: "Open the coverage report in your browser."
|
|
cmds:
|
|
- task: cov
|
|
- go tool cover -html=coverage.txt
|
|
|
|
i18n:generate:
|
|
desc: "Regenerate i18n key constants from locale files"
|
|
cmds:
|
|
- go generate ./pkg/i18n/...
|
|
|
|
i18n:validate:
|
|
desc: "Validate i18n key usage across the codebase"
|
|
cmds:
|
|
- go run ./internal/tools/i18n-validate ./...
|