Skip to content

Format switch case blocks without redundant braces - #8677

Open
cknitt wants to merge 3 commits into
masterfrom
codex/switch-case-braces
Open

cknitt wants to merge 3 commits into
masterfrom
codex/switch-case-braces

Conversation

@cknitt

@cknitt cknitt commented Sep 26, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Omit optional braces around multi-statement switch case bodies, matching single-expression cases.
  • Keep block bodies on separate indented lines and retain braces around inner expressions.
  • Update syntax snapshots and source files affected by the formatter change.

Signed-off-by: Christoph Knittel <ck@cca.io>
Signed-off-by: Christoph Knittel <ck@cca.io>
@cknitt
cknitt marked this pull request as ready for review September 26, 2026 05:38

@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: b2d5e5cfdc

ℹ️ 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 tests/syntax_tests/data/printer/expr/switch.res
Comment thread CHANGELOG.md
@codecov

codecov Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.57%. Comparing base (5b00bcf) to head (73a7957).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #8677   +/-   ##
=======================================
  Coverage   78.57%   78.57%           
=======================================
  Files         476      476           
  Lines       64157    64157           
=======================================
+ Hits        50413    50414    +1     
+ Misses      13744    13743    -1     
Files with missing lines Coverage Δ
compiler/syntax/src/res_printer.ml 93.47% <100.00%> (+0.07%) ⬆️

... and 1 file with indirect coverage changes

🚀 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 26, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

rescript

npm i https://pkg.pr.new/rescript@8677

@rescript/belt

npm i https://pkg.pr.new/@rescript/belt@8677

@rescript/darwin-arm64

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

@rescript/darwin-x64

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

@rescript/linux-arm64

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

@rescript/linux-x64

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

@rescript/runtime

npm i https://pkg.pr.new/@rescript/runtime@8677

@rescript/win32-x64

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

commit: 73a7957

@github-actions

Copy link
Copy Markdown

@cknitt
cknitt added this pull request to stack #8679 September 26, 2026 06:13
Signed-off-by: Christoph Knittel <ck@cca.io>

This branch has not been deployed

No deployments
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