Repository navigation
Fix the indentation of exported code - #1997
Conversation
Each command's emitted block is kept whole again, and each line of a block is rendered at the block's starting level plus the line's own level. Before, the blocks were flattened, so the level changes from if/else/loops were lost and the exported code had no indentation. Python exports didn't compile. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
/agentic_review |
PR Summary by QodoRestore indentation in exported test code
AI Description
Diagram
High-Level Assessment
Files changed (13)
|
Code Review by Qodo
1.
|
renderCommands accepts a block again, and renderCommand renders a block with origin tracing one command at a time, like before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
/agentic_review |
|
Code review by qodo was updated up to the latest commit f2bf0be |
Description
emitCommandskeeps each command's emitted block whole instead of flattening it into loose lines. A block'sstartingLevelAdjustmentandendingLevelAdjustmentnow apply again.prettifyrenders each line of a block at the block's starting level plus the line's own level, like v3 did.renderwalks a list of commands with a running level: each command starts at the level the previous one ended at.repeatIftest, a hook test and the render tests (they used the v3TestCasemodel; now a plain object). Added a render test for a block that indents the lines after it.else/else ifblocks at level 0.Motivation and Context
Exported code lost its indentation: method bodies in Python were at class level, and
if/loop bodies weren't indented. I exported every project intests/examplesin all six languages, before and after:The remaining failures are other bugs, not indentation: variables inside strings (
${name}) are exported as broken code, and an emptytimesloop has no body in Python.Comments from a command's description also show up above the right command now.
Types of changes
Checklist
🤖 Generated with Claude Code