ArchDoc Design record
ArchDoc
ADR-0025 Proposed

The dependency list adds pflag and x/text

Created
Versions
History

Context

ADR-0005 closes the dependency list at cobra, yaml.v3, huh, x/term and goreleaser, and ADR-0006 gives the list as staying at five. The code imports two modules the list does not name:

Module Imported by For
github.com/spf13/pflag cmd/archdoc Walking each command's flags into the command reference. cobra gives a command's flags as a *pflag.FlagSet, and visiting them names pflag's types.
golang.org/x/text internal/changes Matching a configured root against git's listing of a revision in Unicode normalisation form C, through unicode/norm.

cobra requires pflag, and huh requires x/text at the version the module names, so each was in the module graph before it was imported directly. pflag was imported with the command reference on , and x/text on , when each revision's documents came to be read under its own root. Neither was recorded against ADR-0005. The pflag import was reported in [#36] on , and the x/text import was found while correcting it on .

Decision

The dependency list is cobra for the command tree, pflag for its flags, yaml.v3 for front matter, huh for prompts, x/term to detect a terminal, x/text for Unicode normalisation, and goreleaser at build time only. Nothing else. A need that would take another library is met with the standard library or not met.

Alternatives

Whether any other module was weighed for either need is not recorded.

Consequences

Easier:

  • The command reference will read cobra's flags through the pflag types cobra gives them as.
  • A root will match git's listing whichever normalisation form either is written in.

Harder:

  • A repository adopting the tool will audit seven names rather than five.

Constrained:

  • A need that would take another library will still be met with the standard library or not met.

Source adr/0025-the-dependency-list-adds-pflag-and-x-text.md · commit 4dda593 · exported