Repository navigation
Releases: canonical/gencodo
Releases · canonical/gencodo
Release list
v0.3.0
Closes #15, #16, #17, #18, #19, #20.
Added
- Functional options on
GenDocs,GenMarkdownTree, andGenRSTTree:WithExampleParser,WithFuncs,WithDryRun,WithHiddenFlags,WithoutHelpFlag(#17) ValidateTemplatesrenders both templates against synthetic data without writing files, for use in unit tests and CI (#18)- Built-in template helpers
slug,anchor,titleCase,trimPrefix,trimSuffix,trimSpace,lower,upper,join,replace; all helpers are now available in the index template too (#16) ExampleParser.BlockSeparatorandExampleParser.DisableIndentDetection; CRLF line endings are normalised and a leading tab counts as indentation (#19)- Exported
CommandData,IndexData, andCommandSummarytypes describing the template data FlagInfogainedShorthand,Type,NoOptDefVal,Deprecated,ShorthandDeprecated,Hidden,Required,SetByCobra- Command template data gained
File,InheritedFlags,Subcommands,Parent,Aliases,Deprecated,Runnable,Annotations; index template data gainedRootandCommands - README: template data reference, helper functions, link formatting patterns, behaviour notes, development and release process (#15)
make lint(golangci-lint v2, config in.golangci.yaml),make reuse, coverage summary inmake test-coverage; CI lint, coverage, and REUSE jobs; Dependabot for Go modules and Actions (#20)- Release workflow publishing a GitHub release from the CHANGELOG section on every
vX.Y.Ztag;make releaserefuses to tag without that section - REUSE compliance:
LICENSES/LGPL-3.0-only.txt,REUSE.toml, SPDX headers on all files
Changed
- Hidden flags (including flags hidden by pflag's
MarkDeprecated) are omitted by default, matching Cobra's help and doc output; useWithHiddenFlags()to include them - Minimum Go version is 1.23; dependencies bumped to cobra 1.10.2 and pflag 1.0.10
- Output files are rendered in memory and written only on success, so a template error no longer leaves partial files; file close errors are reported
- The command template is parsed once per tree instead of once per command, and template parse errors are reported before any file or directory is created
HeadingLencounts characters rather than bytes- A
nilfile prepender is accepted - The generator function types changed (trailing
...Option); calls are source-compatible, but code that assigned a generator to a variable of the old function type must be updated
Fixed
- GoDoc claimed the command prefix is stripped from
ExampleInfo.Usage; it is kept verbatim, as it always was - GoDoc claimed
MinIndent: 0disables indentation detection; it selects the default of 2 (useDisableIndentDetection) - GoDoc and README claimed
.Filesis sorted alphabetically; it follows Cobra's command order - README listed a non-existent
headingLenhelper and misdescribedreplaceSpaces
v0.2.1
v0.2.0
Added
- Panic recovery around template execution to turn panics into errors
- Concurrent usage test coverage and
make test-racetarget - Comprehensive GoDoc for exported types (
FlagInfo,ExampleInfo,ExampleParser,TemplateInfo)
Changed
- BREAKING: Removed the unused
linkHandlerparameter fromGenDocs,GenMarkdownTree, andGenRSTTree; link formatting now lives entirely in templates
Migration:
// before
gencodo.GenRSTTree(rootCmd, dir, templates, filePrepender, linkHandler)
// after
gencodo.GenRSTTree(rootCmd, dir, templates, filePrepender)