summaryrefslogtreecommitdiff
path: root/Magefile.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-09-07 11:26:10 +0300
committerPaul Buetow <paul@buetow.org>2025-09-07 11:26:10 +0300
commit8889949ad3851bfbf36ff5b73128286d67c88201 (patch)
tree0f515ae6ee3da898dea113799c09e943f3e3f8fb /Magefile.go
parent7c0266e94378f6121719939c6d53915eb72eed3e (diff)
tiding up
Diffstat (limited to 'Magefile.go')
-rw-r--r--Magefile.go62
1 files changed, 31 insertions, 31 deletions
diff --git a/Magefile.go b/Magefile.go
index dedb72c..bd55ef6 100644
--- a/Magefile.go
+++ b/Magefile.go
@@ -17,16 +17,16 @@ import (
)
var (
- Default = Build // Default target: build all binaries.
- coverageThreshold float64 = 85
- coveragePrinted = make(chan struct{}, 1)
+ Default = Build // Default target: build all binaries.
+ coverageThreshold float64 = 85
+ coveragePrinted = make(chan struct{}, 1)
)
// Build builds the Hexai LSP and CLI binaries.
func Build() error {
- mg.Deps(BuildHexaiLSP, BuildHexaiCLI, BuildHexaiAction)
- printCoverage()
- return nil
+ mg.Deps(BuildHexaiLSP, BuildHexaiCLI, BuildHexaiAction)
+ printCoverage()
+ return nil
}
// BuildHexaiLSP builds the LSP server binary.
@@ -37,27 +37,27 @@ func BuildHexaiLSP() error {
// BuildHexaiCLI builds the CLI binary.
func BuildHexaiCLI() error {
- printCoverage()
- return sh.RunV("go", "build", "-o", "hexai", "cmd/hexai/main.go")
+ printCoverage()
+ return sh.RunV("go", "build", "-o", "hexai", "cmd/hexai/main.go")
}
// BuildHexaiAction builds the hexai-action TUI binary.
func BuildHexaiAction() error {
- printCoverage()
- return sh.RunV("go", "build", "-o", "hexai-action", "cmd/internal/hexai-action/main.go")
+ printCoverage()
+ return sh.RunV("go", "build", "-o", "hexai-action", "cmd/internal/hexai-action/main.go")
}
// Dev runs tests, vet, lint, then builds with race for both binaries.
func Dev() error {
- printCoverage()
- mg.Deps(Test, Vet, Lint)
- if err := sh.RunV("go", "build", "-race", "-o", "hexai-lsp", "cmd/hexai-lsp/main.go"); err != nil {
- return err
- }
- if err := sh.RunV("go", "build", "-race", "-o", "hexai", "cmd/hexai/main.go"); err != nil {
- return err
- }
- return sh.RunV("go", "build", "-race", "-o", "hexai-action", "cmd/internal/hexai-action/main.go")
+ printCoverage()
+ mg.Deps(Test, Vet, Lint)
+ if err := sh.RunV("go", "build", "-race", "-o", "hexai-lsp", "cmd/hexai-lsp/main.go"); err != nil {
+ return err
+ }
+ if err := sh.RunV("go", "build", "-race", "-o", "hexai", "cmd/hexai/main.go"); err != nil {
+ return err
+ }
+ return sh.RunV("go", "build", "-race", "-o", "hexai-action", "cmd/internal/hexai-action/main.go")
}
// Run launches the LSP server via go run (useful during development).
@@ -77,8 +77,8 @@ func RunCLI() error {
// Install copies built binaries to GOPATH/bin (defaults to ~/go/bin when GOPATH is unset).
func Install() error {
- printCoverage()
- mg.Deps(Build)
+ printCoverage()
+ mg.Deps(Build)
gopath := os.Getenv("GOPATH")
if gopath == "" {
home, err := os.UserHomeDir()
@@ -91,20 +91,20 @@ func Install() error {
if err := os.MkdirAll(bin, 0o755); err != nil {
return err
}
- if err := sh.RunV("cp", "-v", "./hexai-lsp", bin+"/"); err != nil {
- return err
- }
- if err := sh.RunV("cp", "-v", "./hexai", bin+"/"); err != nil {
- return err
- }
- return sh.RunV("cp", "-v", "./hexai-action", bin+"/")
+ if err := sh.RunV("cp", "-v", "./hexai-lsp", bin+"/"); err != nil {
+ return err
+ }
+ if err := sh.RunV("cp", "-v", "./hexai", bin+"/"); err != nil {
+ return err
+ }
+ return sh.RunV("cp", "-v", "./hexai-action", bin+"/")
}
// RunAction runs the hexai-action TUI via go run (reads stdin).
func RunAction() error {
- printCoverage()
- mg.Deps(Dev)
- return sh.RunV("go", "run", "cmd/internal/hexai-action/main.go")
+ printCoverage()
+ mg.Deps(Dev)
+ return sh.RunV("go", "run", "cmd/internal/hexai-action/main.go")
}
// printCoverage prints a warning if an existing coverage profile shows total < coverateThreshold.