CodeVetter · Repo Unpack · Contributor handoff
spf13/cobra
Start by identifying whether a change affects resolution, parsing, lifecycle, completion protocol, or document rendering. Read its implementation and nearby tests together, because command state and generated output are coupled. Preserve compatibility branches and use existing test helpers for focused changes. Tests and CI were inspected, not executed here; proposed checks require separate execution authorization under the task's restrictions.
- Use the README and user guide to distinguish this library from the separately installed cobra-cli generator; consuming applications construct their own root Command and main function.
- Read ExecuteC, execute, Find/Traverse, and ParseFlags together before changing dispatch; TraverseChildren changes parent parsing, and nil Args invokes legacy lookup validation.
- Preserve Go 1.15 compatibility and dual platform build tags; lint explicitly disables govet's buildtag check for that compatibility requirement.
- Use executeCommand/executeCommandC to inject arguments and capture streams; tests manipulating global hook behavior should account for EnableTraverseRunHooks affecting other command trees.
- For completion edits, preserve the copied input slice, static ValidArgs precedence, final :<directive> protocol line, and the regression that verifies os.Args remains unchanged.
- Avoid treating rendering as pure observation: Markdown initializes help and redirects flag output, while legacy Bash sorts argument/alias slices and changes completion annotations.
- Recommended implementation validation is a focused Go test followed by go test ./... and applicable formatting/lint checks; make test and make richtest first invoke go get, so they cross a dependency-download boundary.
- Tests and CI were inspected, not executed in this investigation: conditional shellcheck and Windows-skipped dead-code checks limit what suite definitions establish, and CI runs richgo without explicit race/coverage options.