Skip to content

refactor: adopt structured multi-line diagnostic format for CLI messages#106

Merged
ebisawa merged 2 commits into
mainfrom
refactor/structured-diagnostic-messages
May 27, 2026
Merged

refactor: adopt structured multi-line diagnostic format for CLI messages#106
ebisawa merged 2 commits into
mainfrom
refactor/structured-diagnostic-messages

Conversation

@ebisawa
Copy link
Copy Markdown
Owner

@ebisawa ebisawa commented May 27, 2026

Summary

  • Standardize all CLI error and warning messages to a structured multi-line format with labeled fields (Reason, Action, Kid, Expires at, etc.) replacing inline prose
  • Reduce TEXT_WIDTH from 100 to 80 columns for better terminal readability
  • Add format_diagnostic_lines layout helper that preserves explicit newlines and applies continuation-indent alignment under the Error:/Warning: prefix
  • Update error formatting to color only the first line and leave detail lines uncolored; warning formatting now colors each line individually

Test plan

  • cargo test --workspace passes with all updated message assertions
  • cargo clippy --workspace --all-targets reports no warnings
  • Manual verification: run commands that trigger errors/warnings and confirm the structured multi-line output renders correctly in 80-column terminals
  • Verify CLI integration tests in tests/cli/ pass (env_key_mode, key/export, kv/unset, member)

ebisawa added 2 commits May 28, 2026 03:46
… warning messages

Standardize all CLI error and warning messages to a structured multi-line
format with labeled fields (Reason, Action, Kid, etc.) and reduce text
width from 100 to 80 columns for better terminal readability. Add
format_diagnostic_lines layout helper that preserves explicit newlines
and applies continuation-indent alignment under the Error:/Warning: prefix.
Replace word-wrapping logic in layout.rs with simple line-break-preserving
formatting. CLI output now renders values inline without splitting at 80
columns, while still honoring explicit newlines in structured diagnostics.
@ebisawa ebisawa merged commit 7792999 into main May 27, 2026
4 checks passed
@ebisawa ebisawa deleted the refactor/structured-diagnostic-messages branch May 27, 2026 19:33
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.

1 participant