{"record":{"id":"2e45c1dcee6f4f79","repo":"gastownhall/beads","slug":"invalid-format-template-w","errorCode":null,"errorMessage":"invalid format template: %w","messagePattern":"invalid format template: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/list_output.go","lineNumber":119,"sourceCode":"\t\treturn outputDotFormat(out, issues, depsByIssueID)\n\t}\n\tw := &graphExportWriter{out: out}\n\n\t// Built-in format presets\n\tpresets := map[string]string{\n\t\t\"digraph\": \"{{.IssueID}} {{.DependsOnID}}\",\n\t}\n\n\t// Check if it's a preset\n\ttemplateStr, isPreset := presets[formatStr]\n\tif !isPreset {\n\t\ttemplateStr = formatStr\n\t}\n\n\t// Parse template\n\ttmpl, err := template.New(\"format\").Parse(templateStr)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"invalid format template: %w\", err)\n\t}\n\n\t// Build map of all issues for quick lookup\n\tissueMap := make(map[string]bool)\n\tfor _, issue := range issues {\n\t\tissueMap[issue.ID] = true\n\t}\n\n\t// For each issue, output its dependencies using the template\n\tfor _, issue := range issues {\n\t\tfor _, dep := range depsByIssueID[issue.ID] {\n\t\t\t// Only output edges where both nodes are in the filtered list\n\t\t\tif issueMap[dep.DependsOnID] {\n\t\t\t\t// Template data includes both issue and dependency info\n\t\t\t\tdata := map[string]interface{}{\n\t\t\t\t\t\"IssueID\":     issue.ID,\n\t\t\t\t\t\"DependsOnID\": dep.DependsOnID,\n\t\t\t\t\t\"Type\":        dep.Type,","sourceCodeStart":101,"sourceCodeEnd":137,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/list_output.go#L101-L137","documentation":"outputFormattedList parses the --format string as a Go text/template; this error wraps the template.Parse failure. It means the user-supplied format string has invalid template syntax. The underlying parse error (line/offset) is wrapped via %w.","triggerScenarios":"`bd list --format '{{.ID'` or any --format value with unbalanced braces, bad actions, or invalid functions passed to template.New(\"format\").Parse.","commonSituations":"Hand-written format strings with typos (`{{.id}` — wrong case or missing brace), shell interpolation mangling braces, copying templates from docs for other tools.","solutions":["Fix the template syntax per the wrapped parse error's line/column","Use double quotes in your shell so braces aren't mangled: --format '{{.ID}} {{.Title}}'","Check field names match Issue struct fields (e.g. {{.Issue.Title}} in dependency context)","Test with a minimal template like '{{.ID}}' first"],"exampleFix":"// before\nbd list --format '{{.ID' \n// after\nbd list --format '{{.ID}} {{.Title}}'","handlingStrategy":"validation","validationCode":"# Sanity-check braces balance before invoking\ntpl='{{.ID}} {{.Title}}'\n[[ $(grep -o '{{' <<<\"$tpl\" | wc -l) -eq $(grep -o '}}' <<<\"$tpl\" | wc -l) ]] || { echo \"unbalanced template braces\"; exit 2; }\nbd list --format \"$tpl\"","typeGuard":null,"tryCatchPattern":"// Catch and surface the wrapped parse error (position info)\nout=$(bd list --format \"$tpl\" 2>&1) || case \"$out\" in\n  *\"invalid format template\"*) echo \"$out\" >&2; exit 1;; esac","preventionTips":["Start from a known-good template like '{{.ID}} {{.Title}}'","Single-quote templates in shell to protect braces and %","Keep Go text/template syntax docs handy; Go template != Jinja"],"tags":["template","cli","formatting"],"backgroundTag":"invalid-template-syntax","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}