Skip to content

Commit c0e2de1

Browse files
committed
Fix doc-dag fixtures and staticcheck warnings
1 parent 0b0b5a2 commit c0e2de1

12 files changed

Lines changed: 53 additions & 26 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ coverage.html
1919
!/.dun/
2020
!/.dun/graphs/
2121
!/.dun/graphs/**
22+
!internal/testdata/repos/**/.dun/
23+
!internal/testdata/repos/**/.dun/graphs/
24+
!internal/testdata/repos/**/.dun/graphs/**
2225
/.dun/config.yaml
2326
test_repo/
2427

cmd/dun/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ func runCheck(args []string, stdout io.Writer, stderr io.Writer) int {
219219
if err := fs.Parse(args); err != nil {
220220
return dun.ExitUsageError
221221
}
222-
explicitConfig = *configPath
222+
_ = *configPath
223223

224224
opts.AgentMode = "prompt"
225225
opts.AutomationMode = *automation

internal/dun/command_check_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1193,8 +1193,8 @@ func TestExtractIssuesFromJSON_NilData(t *testing.T) {
11931193
}
11941194

11951195
issues := extractIssuesFromJSON(check, nil)
1196-
if issues != nil && len(issues) != 0 {
1197-
t.Errorf("expected nil or empty issues for nil data, got %v", issues)
1196+
if len(issues) != 0 {
1197+
t.Errorf("expected no issues for nil data, got %v", issues)
11981198
}
11991199
}
12001200

internal/dun/engine_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ func TestDocDagCascadeStale(t *testing.T) {
111111
if !containsStringSlice(check.Prompt.Inputs, "docs/helix/01-frame/prd.md") {
112112
t.Fatalf("expected PRD input, got %+v", check.Prompt.Inputs)
113113
}
114-
if !containsStringSlice(check.Prompt.Inputs, "docs/helix/02-design/adrs/ADR-001.md") {
114+
if !containsStringSlice(check.Prompt.Inputs, "docs/helix/02-design/adr/ADR-001.md") {
115115
t.Fatalf("expected ADR input, got %+v", check.Prompt.Inputs)
116116
}
117117
if !containsStringSlice(check.Prompt.Inputs, "internal/feature/feature.go") {

internal/dun/gates_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ func TestSplitEvidence(t *testing.T) {
150150
if path != "docs/a.md" || anchor != "Section One" {
151151
t.Fatalf("unexpected split: %s %s", path, anchor)
152152
}
153-
path, anchor = splitEvidence("docs/a.md")
153+
_, anchor = splitEvidence("docs/a.md")
154154
if anchor != "" {
155155
t.Fatalf("expected empty anchor")
156156
}

internal/dun/harness_test.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,16 +74,6 @@ func assertArgsContain(t *testing.T, args []string, required []string) {
7474
}
7575
}
7676

77-
func assertArgsContainSubstring(t *testing.T, args []string, needle string) {
78-
t.Helper()
79-
for _, arg := range args {
80-
if strings.Contains(arg, needle) {
81-
return
82-
}
83-
}
84-
t.Fatalf("expected args to contain %q, got %v", needle, args)
85-
}
86-
8777
func assertFlagValue(t *testing.T, args []string, flag string, value string) {
8878
t.Helper()
8979
for i, arg := range args {

internal/dun/reconcile_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,6 @@ func detectImpactedArtifacts(root string) ([]string, error) {
472472
type orderedArtifact struct {
473473
path string
474474
priority int
475-
subOrder int // For deterministic ordering within category
476475
}
477476

478477
var ordered []orderedArtifact
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
required_roots:
2+
- helix.prd
3+
id_map:
4+
helix.prd: docs/helix/01-frame/prd.md
5+
helix.architecture: docs/helix/02-design/architecture.md
6+
helix.test-plan: docs/helix/03-test/test-plan.md
7+
F-{id}: docs/helix/01-frame/features/F-{id}-*.md
8+
US-{id}: docs/helix/01-frame/user-stories/US-{id}-*.md
9+
SD-{id}: docs/helix/02-design/solution-designs/SD-{id}-*.md
10+
TP-{id}: docs/helix/03-test/test-plans/TP-{id}-*.md
11+
IP-{id}: docs/helix/04-build/implementation-plans/IP-{id}-*.md
12+
ADR-{id}: docs/helix/02-design/adr/ADR-{id}.md
13+
prompt_defaults:
14+
helix.prd: prompts/implementation-plan.md
15+
default_prompt: prompts/implementation-plan.md

internal/testdata/repos/doc-dag-cascade/docs/helix/02-design/adrs/ADR-001.md renamed to internal/testdata/repos/doc-dag-cascade/docs/helix/02-design/adr/ADR-001.md

File renamed without changes.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
required_roots:
2+
- helix.prd
3+
id_map:
4+
helix.prd: docs/helix/01-frame/prd.md
5+
helix.architecture: docs/helix/02-design/architecture.md
6+
helix.test-plan: docs/helix/03-test/test-plan.md
7+
F-{id}: docs/helix/01-frame/features/F-{id}-*.md
8+
US-{id}: docs/helix/01-frame/user-stories/US-{id}-*.md
9+
SD-{id}: docs/helix/02-design/solution-designs/SD-{id}-*.md
10+
TP-{id}: docs/helix/03-test/test-plans/TP-{id}-*.md
11+
IP-{id}: docs/helix/04-build/implementation-plans/IP-{id}-*.md
12+
ADR-{id}: docs/helix/02-design/adr/ADR-{id}.md
13+
prompt_defaults:
14+
helix.prd: prompts/implementation-plan.md
15+
default_prompt: prompts/implementation-plan.md

0 commit comments

Comments
 (0)