Skip to content

Conversation

@DiogoRibeiro7
Copy link

Linked Issue

Closes #N/A

Description

Made the CLI respect the --indent flag when decoding TOON so the emitted JSON formatting matches the user’s request, and added a regression test to lock in that behavior.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement
  • Test coverage improvement

Changes Made

  • Passed the requested indent value through to json.dumps in decode_toon_to_json.
  • Added a CLI test that decodes TOON with --indent 4 and asserts the output uses four-space indentation.
  • Updated the CLI regression suite to cover the new formatting behavior.

SPEC Compliance

  • This PR implements/fixes spec compliance
  • Spec section(s) affected:
  • Spec version:

Testing

  • All existing tests pass
  • Added new tests for changes
  • Tests cover edge cases and spec compliance
    • uv run pytest tests/test_cli.py -k decode_indent

Pre-submission Checklist

  • My code follows the project's coding standards
  • I have run code formatting/linting tools
  • I have added tests that prove my fix/feature works
  • New and existing tests pass locally
  • I have updated documentation if needed
  • I have reviewed the TOON specification for relevant sections

Breaking Changes

  • No breaking changes
  • Breaking changes (describe migration path below)

Additional Context

Ensures the CLI indent option behaves consistently during both encoding and decoding so users can control JSON formatting on both sides of the conversion.

@DiogoRibeiro7 DiogoRibeiro7 requested a review from a team as a code owner January 14, 2026 15:37
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