Fix unstable formatting of trailing callback comments - #8627
Conversation
Signed-off-by: Christoph Knittel <ck@cca.io>
Signed-off-by: Christoph Knittel <ck@cca.io>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 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".
|
|
||
| #### :bug: Bug fix | ||
|
|
||
| - Fix unstable formatting of trailing comments in nested callbacks. https://github.com/rescript-lang/rescript/issues/6976 |
There was a problem hiding this comment.
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 Report✅ All modified and coverable lines are covered by tests. 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
🚀 New features to boost your workflow:
|
rescript
@rescript/belt
@rescript/darwin-arm64
@rescript/darwin-x64
@rescript/linux-arm64
@rescript/linux-x64
@rescript/runtime
@rescript/win32-x64
commit: |
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-syntaxmake test-syntax-roundtripdune exec syntax_testsmake checkformat