Skip to content

tools: add verified atomic toit format command - #3191

Open
floitsch wants to merge 2 commits into
formatter/05-comment-preservationfrom
formatter/06-cli-gold-tests
Open

floitsch wants to merge 2 commits into
formatter/05-comment-preservationfrom
formatter/06-cli-gold-tests

Conversation

@floitsch

@floitsch floitsch commented Aug 26, 2026

Copy link
Copy Markdown
Member

Part 6 of 10 in the AST-driven Toit pretty-printer stack. Depends on #3190.

Summary

  • add the toit format command
  • reject input with parse errors
  • reparse output and require structural AST equivalence
  • verify comment fingerprints before installation
  • install changed files atomically
  • add public-command gold tests with a second idempotence pass

User-visible formatter behavior lives in gold files. CTests remain limited to mechanisms that cannot be observed through toit format.

Verification

  • formatter gold tests pass for expressions, declarations, and comments
  • parse-error and verifier-rejection tests pass
  • atomic replacement failure tests pass

Stack created with GitHub Stacks CLI

@floitsch floitsch changed the title formatter/06 cli gold tests tools: add verified atomic toit format command Aug 26, 2026
@floitsch
floitsch force-pushed the formatter/06-cli-gold-tests branch from deac25f to b4794b6 Compare August 30, 2026 11:08
@floitsch
floitsch force-pushed the formatter/06-cli-gold-tests branch from b4794b6 to 89a6025 Compare August 30, 2026 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant