Skip to content

feat: add max_summary_length config option (#127) - #201

Draft
kimjune01 wants to merge 3 commits into
cococonscious:mainfrom
kimjune01:feat/max-summary-length
Draft

feat: add max_summary_length config option (#127)#201
kimjune01 wants to merge 3 commits into
cococonscious:mainfrom
kimjune01:feat/max-summary-length

Conversation

@kimjune01

Copy link
Copy Markdown

Summary

  • Add max_summary_length configuration option to limit commit summary length
  • Configurable via .koji.toml (max_summary_length = 72) and CLI (--max-summary-length 72)
  • CLI flag overrides config file value; uses chars().count() for correct Unicode handling
  • Validation runs inline during prompt, showing current vs. maximum character count

Fixes #127

Test plan

  • 24 unit tests + 16 integration tests all pass
  • Tests cover: default (no limit), config file, CLI override, empty input, exceeding limit
  • cargo clippy clean, rustfmt applied

kimjune01 added 3 commits May 11, 2026 21:12
Implements configurable character limit for commit summaries.

- Add max_summary_length field to Config, ConfigTOML, and ConfigArgs
- Add validate_summary_with_max_length function with length checking
- Wire max_summary_length through prompt_summary to validator
- Add CLI flag --max-summary-length for runtime override
- Add comprehensive tests for validation and config loading
- Default behavior unchanged (no limit unless configured)

Closes cococonscious#127
The old validate_summary function became dead code when
validate_summary_with_max_length replaced it. Updated the test
to call the new function with None (equivalent behavior).
@kimjune01
kimjune01 marked this pull request as draft May 18, 2026 06:06
@kimjune01

Copy link
Copy Markdown
Author

PR lacks a test exercising the change, so drafting. Please close or take it over.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add commit title message max_length option

1 participant