Skip to content

fix(fmt): preserve tuple and mapping comments - #16786

Merged
mablr merged 1 commit into
masterfrom
fig/fmt-line-comments
Sep 10, 2026
Merged

fix(fmt): preserve tuple and mapping comments#16786
mablr merged 1 commit into
masterfrom
fig/fmt-line-comments

Conversation

@figtracer

Copy link
Copy Markdown
Member

Line comments in omitted tuple elements and mapping keys can absorb the following Solidity tokens, leaving forge fmt output unparsable. Preserve their terminating line breaks while retaining inline block-comment handling, with regression fixtures for tuple omissions and named, unnamed, and nested mappings. Related to #16649. Written with Codex assistance for implementation and regression tests.

Keep terminating line breaks when formatting omitted tuple elements and mapping keys so comments cannot swallow subsequent Solidity tokens. Cover tuple omissions and named, unnamed, and nested mappings.
@github-actions

Copy link
Copy Markdown
Contributor

✅ Changelog found

The deterministic check will validate the changed entry.

@figtracer
figtracer marked this pull request as ready for review September 10, 2026 19:52

@mattsse mattsse left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm

@mablr
mablr merged commit 041c4d2 into master Sep 10, 2026
42 checks passed
@mablr
mablr deleted the fig/fmt-line-comments branch September 10, 2026 21:48
@github-project-automation github-project-automation Bot moved this to Done in Foundry Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants