feat: add lint check to bd preflight --check (bd-lfak.3)
- Add Skipped field to CheckResult for graceful handling of missing tools - Implement runLintCheck() that runs golangci-lint run ./... - Skip lint check gracefully if golangci-lint not in PATH - Update summary to show skipped count separately - Add test for skipped state 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Executed-By: beads/crew/dave Rig: beads Role: crew
This commit is contained in:
committed by
Steve Yegge
parent
64c65974f0
commit
1b432ad9b6
@@ -100,6 +100,32 @@ func TestPreflightResult_SomeFailed(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestPreflightResult_WithSkipped(t *testing.T) {
|
||||
results := PreflightResult{
|
||||
Checks: []CheckResult{
|
||||
{Name: "Tests pass", Passed: true, Command: "go test ./..."},
|
||||
{Name: "Lint passes", Passed: false, Skipped: true, Command: "golangci-lint run", Output: "not installed"},
|
||||
},
|
||||
Passed: true,
|
||||
Summary: "1/1 checks passed (1 skipped)",
|
||||
}
|
||||
|
||||
// Skipped checks don't count as failures
|
||||
if !results.Passed {
|
||||
t.Error("Expected result to pass (skipped doesn't count as failure)")
|
||||
}
|
||||
|
||||
skipCount := 0
|
||||
for _, c := range results.Checks {
|
||||
if c.Skipped {
|
||||
skipCount++
|
||||
}
|
||||
}
|
||||
if skipCount != 1 {
|
||||
t.Errorf("Expected 1 skipped, got %d", skipCount)
|
||||
}
|
||||
}
|
||||
|
||||
func TestTruncateOutput(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
|
||||
Reference in New Issue
Block a user