Skip to content

Fix unstable formatting of trailing callback comments - #8627

Open
cknitt wants to merge 2 commits into
masterfrom
codex/fix-callback-comment-formatting
Open

Fix unstable formatting of trailing callback comments#8627
cknitt wants to merge 2 commits into
masterfrom
codex/fix-callback-comment-formatting

Conversation

@cknitt

@cknitt cknitt commented Sep 4, 2026

Copy link
Copy Markdown
Member

Trailing comments in nested callbacks could move outward across successive formatting passes. Use the regular argument layout when arguments have trailing comments so formatting is stable after the first pass.

Add regression coverage for nested callbacks, first and last callback arguments, and line and block comments, including stability checks at five print widths.

Fixes #6976.

Validation:

  • make test-syntax
  • make test-syntax-roundtrip
  • dune exec syntax_tests
  • make checkformat

Signed-off-by: Christoph Knittel <ck@cca.io>
Signed-off-by: Christoph Knittel <ck@cca.io>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 4, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-04T19:59:20.542567Z 3ca9d2e PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3ca9d2eda3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread CHANGELOG.md Outdated

#### :bug: Bug fix

- Fix unstable formatting of trailing comments in nested callbacks. https://github.com/rescript-lang/rescript/issues/6976

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Link the changelog entry to the implementing PR

For this user-facing formatter fix, the new entry ends with the issue URL (/issues/6976), but repository guidance requires entries in the current Unreleased section to end with the implementing PR link. Replace this URL with the PR URL so the changelog follows the required attribution format.

AGENTS.md reference: AGENTS.md:L150-L150

Useful? React with 👍 / 👎.

@codecov

codecov Bot commented Sep 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.32%. Comparing base (cf94640) to head (c66b8ec).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #8627   +/-   ##
=======================================
  Coverage   77.32%   77.32%           
=======================================
  Files         467      467           
  Lines       63313    63317    +4     
=======================================
+ Hits        48957    48961    +4     
  Misses      14356    14356           
Files with missing lines Coverage Δ
compiler/syntax/src/res_printer.ml 92.96% <100.00%> (+<0.01%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pkg-pr-new

pkg-pr-new Bot commented Sep 4, 2026

Copy link
Copy Markdown

Open in StackBlitz

rescript

npm i https://pkg.pr.new/rescript-lang/rescript@8627

@rescript/belt

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/belt@8627

@rescript/darwin-arm64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/darwin-arm64@8627

@rescript/darwin-x64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/darwin-x64@8627

@rescript/linux-arm64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/linux-arm64@8627

@rescript/linux-x64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/linux-x64@8627

@rescript/runtime

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/runtime@8627

@rescript/win32-x64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/win32-x64@8627

commit: c66b8ec

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.

Unstable formatting of comments

1 participant