Skip to content

fix(compare): normalize numeric literals and object literal formatting#54

Merged
Brooooooklyn merged 1 commit intomainfrom
03-03-fix_compare_numeric_and_object_literals
Mar 3, 2026
Merged

fix(compare): normalize numeric literals and object literal formatting#54
Brooooooklyn merged 1 commit intomainfrom
03-03-fix_compare_numeric_and_object_literals

Conversation

@Brooooooklyn
Copy link
Member

@Brooooooklyn Brooooooklyn commented Mar 3, 2026

Add two normalizations to the comparison tool to reduce false positives:

  • Numeric literals: AST-based normalization using oxc-parser converts
    scientific notation (1e3, 2e3) to decimal form (1000, 2000). Key
    finding: oxc-parser returns character offsets, not byte offsets.

  • Object literal formatting: regex-based collapsing of multi-line simple
    object literals in function call arguments to single lines. Only
    targets objects with identifier/member-expression values.

Results: numeric diffs 4 → 0, line count diffs 304 → 301, 0 parse errors.

Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com


Note

Cursor Bugbot is generating a summary for commit c403ad1. Configure here.

Copy link
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Add two normalizations to the comparison tool to reduce false positives:

- Numeric literals: AST-based normalization using oxc-parser converts
  scientific notation (1e3, 2e3) to decimal form (1000, 2000). Key
  finding: oxc-parser returns character offsets, not byte offsets.

- Object literal formatting: regex-based collapsing of multi-line simple
  object literals in function call arguments to single lines. Only
  targets objects with identifier/member-expression values.

Results: numeric diffs 4 → 0, line count diffs 304 → 301, 0 parse errors.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Brooooooklyn Brooooooklyn force-pushed the 03-03-fix_compare_numeric_and_object_literals branch from c403ad1 to 568a8a3 Compare March 3, 2026 14:28
@Brooooooklyn Brooooooklyn merged commit 23f21f2 into main Mar 3, 2026
4 checks passed
@Brooooooklyn Brooooooklyn deleted the 03-03-fix_compare_numeric_and_object_literals branch March 3, 2026 14:41
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