Add `core go qa` command with subcommands: - fmt: check/fix code formatting (gofmt) - vet: run go vet - lint: run golangci-lint - test: run tests - race: run tests with race detector - vuln: check for vulnerabilities (govulncheck) - sec: run security scanner (gosec) - quick: fmt, vet, lint only - full: all checks Default (no subcommand) runs fmt, vet, lint, test. All commands support --fix flag where applicable. Also update Taskfile.yml to use core CLI commands throughout. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
36 lines
803 B
Go
36 lines
803 B
Go
// Package gocmd provides Go development commands.
|
|
//
|
|
// Note: Package named gocmd because 'go' is a reserved keyword.
|
|
package gocmd
|
|
|
|
import (
|
|
"github.com/host-uk/core/pkg/cli"
|
|
"github.com/host-uk/core/pkg/i18n"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
// Style aliases for shared styles
|
|
var (
|
|
successStyle = cli.SuccessStyle
|
|
errorStyle = cli.ErrorStyle
|
|
dimStyle = cli.DimStyle
|
|
)
|
|
|
|
// AddGoCommands adds Go development commands.
|
|
func AddGoCommands(root *cobra.Command) {
|
|
goCmd := &cobra.Command{
|
|
Use: "go",
|
|
Short: i18n.T("cmd.go.short"),
|
|
Long: i18n.T("cmd.go.long"),
|
|
}
|
|
|
|
root.AddCommand(goCmd)
|
|
addGoQACommand(goCmd)
|
|
addGoTestCommand(goCmd)
|
|
addGoCovCommand(goCmd)
|
|
addGoFmtCommand(goCmd)
|
|
addGoLintCommand(goCmd)
|
|
addGoInstallCommand(goCmd)
|
|
addGoModCommand(goCmd)
|
|
addGoWorkCommand(goCmd)
|
|
}
|