Skip to content

feat: add since init subcommand#9

Draft
outofcoffee wants to merge 1 commit into
mainfrom
feat/init-subcommand
Draft

feat: add since init subcommand#9
outofcoffee wants to merge 1 commit into
mainfrom
feat/init-subcommand

Conversation

@outofcoffee

Copy link
Copy Markdown
Collaborator

Add a `since init` subcommand that creates a `since.yaml` config file with embedded examples for branch requirements, hooks, and commit exclusions.

Summary

  • Add `init` subcommand to create a `since.yaml` config file with comprehensive documented examples
  • Embed the config template into the binary using `//go:embed` to avoid external file dependencies
  • Export `DefaultConfigFile` constant from `cfg` package for consistent config filename references
  • Add unit tests covering directory output, config content validation, and hook/ignore/requireBranch examples

Implementation details

  • The config template (`cmd/templates/since.yaml`) uses `//go:embed` to bake examples into the binary, ensuring the init command works without external file dependencies
  • Tests use `strings.Contains` for flexible content validation rather than exact string matching, making them resilient to whitespace and ordering changes in the template
  • Exposed `DefaultConfigFile` as a package-level constant in `cfg/config.go` so the init command references the same default filename as the config loader

@outofcoffee outofcoffee added the enhancement New feature or request label Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant