Skip to content

refactor(debug): convert pretty-print helpers to Repr methods#3284

Open
bobzhang wants to merge 1 commit intomainfrom
hongbo/refactor-debug-pretty-print
Open

refactor(debug): convert pretty-print helpers to Repr methods#3284
bobzhang wants to merge 1 commit intomainfrom
hongbo/refactor-debug-pretty-print

Conversation

@bobzhang
Copy link
Copy Markdown
Contributor

@bobzhang bobzhang commented Mar 15, 2026

Summary

  • Merge prune_repr_info and prune_info into a single Repr::prune_info method with max_depth~ : Int?
  • Rename pretty_print_repr_go to Repr::pretty_print and render_repr to Repr::render_repr
  • Inline quote_string_literal (was just s.escape()) and remove it
  • Simplify is_unquoted_key using string pattern matching with is syntax
  • Use [first, ..rest] destructuring with spread construction instead of manual slicing
  • Use s is ['-',..] pattern instead of index-based check for Integer sign detection

Test plan

  • moon check passes (pre-existing errors in builtin are unrelated)
  • CI passes

🤖 Generated with Claude Code


Open with Devin

Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 4 additional findings.

Open in Devin Review

@bobzhang bobzhang force-pushed the hongbo/refactor-debug-pretty-print branch 2 times, most recently from 05037ca to be46fd3 Compare March 15, 2026 15:47
@coveralls
Copy link
Copy Markdown
Collaborator

coveralls commented Mar 15, 2026

Pull Request Test Coverage Report for Build 2887

Details

  • 34 of 37 (91.89%) changed or added relevant lines in 2 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.02%) to 95.788%

Changes Missing Coverage Covered Lines Changed/Added Lines %
debug/pretty_print.mbt 24 27 88.89%
Files with Coverage Reduction New Missed Lines %
debug/pretty_print.mbt 1 89.09%
Totals Coverage Status
Change from base Build 2884: 0.02%
Covered Lines: 13737
Relevant Lines: 14341

💛 - Coveralls

…plify

- Merge `prune_repr_info` and `prune_info` into `Repr::prune_info`
- Rename `pretty_print_repr_go` to `Repr::pretty_print`
- Rename `render_repr` to `Repr::render_repr`
- Inline `quote_string_literal` (just `s.escape()`)
- Simplify `is_unquoted_key` using string pattern matching
- Use `[first, ..rest]` destructuring with spread construction
- Use `s is ['-',..]` pattern instead of index check for Integer

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@bobzhang bobzhang force-pushed the hongbo/refactor-debug-pretty-print branch from be46fd3 to 092d48d Compare March 15, 2026 15:52
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.

2 participants