Skip to content

Conversation

@0xrusowsky
Copy link
Contributor

Motivation

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

@grandizzy grandizzy force-pushed the rusowsky/fmt-chores branch from 68013ca to f91e1a5 Compare October 25, 2025 11:00
@grandizzy grandizzy force-pushed the rusowsky/fmt-chores branch from f91e1a5 to dc9bc7b Compare October 25, 2025 13:48
DaniPopes
DaniPopes previously approved these changes Oct 25, 2025
@grandizzy grandizzy self-requested a review October 26, 2025 16:16
Copy link
Collaborator

@grandizzy grandizzy left a comment

Choose a reason for hiding this comment

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

make sense! should we apply prefer compact config to emits and reverts with named args too? e.g. if we don't have preferred compact events then break also emit as

        emit WithdrawFromLockupStream({
            streamId: ids.defaultStream,
            to: users.recipient,
            token: dai,
            amount: withdrawAmount
        });

and if we don't prefer compact reverts then break also revert as

        revert InsufficientBalance({
            balance: bal,
            withdrawAmount: _withdrawAmount,
            address1: _address,
            token: dai,
            to: users.recipient
        });

@0xrusowsky
Copy link
Contributor Author

good call, will do it!

Copy link
Collaborator

@grandizzy grandizzy left a comment

Choose a reason for hiding this comment

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

lgtm!

@grandizzy
Copy link
Collaborator

I think there's one more case that is not covered but we can fix in a follow-up if so - with prefer_compact = "none"

         // Make the withdrawal.
         lockup.withdraw{ value: LOCKUP_MIN_FEE_WEI }({
-            streamId: differentSenderRecipientStreamId,
-            to: address(recipientGood),
-            amount: withdrawAmount
+            streamId: differentSenderRecipientStreamId, to: address(recipientGood), amount: withdrawAmount
         });
     }
}

@grandizzy grandizzy added this pull request to the merge queue Oct 27, 2025
Merged via the queue into master with commit 17bbb40 Oct 27, 2025
15 checks passed
@grandizzy grandizzy deleted the rusowsky/fmt-chores branch October 27, 2025 05:33
@github-project-automation github-project-automation bot moved this to Done in Foundry Oct 27, 2025
grandizzy added a commit to grandizzy/foundry that referenced this pull request Oct 27, 2025
…rs#12281)

* fix: indentation in operator exprs with parentheses

* docs: new param

* feat: prefer_compact

* fix: test

* style: typo

* fix: default config test

* Fix wrap comments test

* fix: emit and revert

---------

Co-authored-by: grandizzy <[email protected]>
grandizzy added a commit that referenced this pull request Oct 30, 2025
* fix(fmt): no trailing cmnts in opening brace of empty blocks (#12241)

* fix(fmt): only print trailing cmnts in opening brace when block is not
empty

* doc: link issue

---------

Co-authored-by: grandizzy <[email protected]>

* fix(fmt): preserve indexed callee when it fits (#12270)

* fix(fmt): preserve indexed callee when it fits

* style: typos

* fix(forge): fix dynamic gas limit check (#12267)

* fix(forge): fix dynamic gas limit check

* add repro

* chore: update traces for p256 precompile test (#12242)

chore: redact part of traces for p256 precompile test

* chore: bump v1.4.4 (#12271)

* fix(forge): update progress on rejected fuzz runs (#12243)

fix: update progress on rejected runs

* feat(fmt): enforce doc comment styling (#11955)

* feat(fmt): force doc comment styling

* tests: add unit tests

* style: clippy + comments

* fix: default config test

* chore(fmt): prefer_compact + indent bin expr w/ parenthesis (#12281)

* fix: indentation in operator exprs with parentheses

* docs: new param

* feat: prefer_compact

* fix: test

* style: typo

* fix: default config test

* Fix wrap comments test

* fix: emit and revert

---------

Co-authored-by: grandizzy <[email protected]>

* chore(docs): default `all` for `prefer_compact` fmt config (#12294)

chore: default all for prefer_compact fmt

* docs(fmt): add `none` variant (#12298)

* feat(fmt): add single_line_imports option to keep single imports on one line (#12303)

* add single_line_imports option to keep single imports on one line

* update readme

* add tests for single_line_imports feature + fmt

* fix clippy and simplify the code

* fix test failed

* fix: simplify

---------

Co-authored-by: 0xrusowsky <[email protected]>
Co-authored-by: grandizzy <[email protected]>

* fix(fmt): keep if stmts inline in assembly blocks (#12306)

fix(fmt): asm inline if stmt

* fix(fmt): prevent double-ind in complex ternary expr (#12317)

* fix(fmt): only indent wrapped trailing block cmnts (#12319)

* fix(fmt): only indent wrapped trailing cmnts which are line cmnts

* style: flip

---------

Co-authored-by: grandizzy <[email protected]>

* fix(fmt): don't break var assignments when callee fits (#12323)

* fix(fmt): don't break var assignments when callee fits

* fix: deindent calls (exception)

* chore: update arb tests, use different rpc url (#12321)

* chore: use drpc arb

* Use other

* fix(fmt): properly calc fn header size (#12343)

* fix(fmt): properly calc fn header size

* docs: add more cmnts

* fix: revert bun.lock changes

* test(fmt): ensure fn header sizes are computed correctly (#12350)

* fix(fmt): properly calc fn header size

* docs: add more cmnts

* fix: revert bun.lock changes

* test: estimate_header_size

* simplify tests

* style: clippy

* chore: patch solar to main rev (#12379)

* chore: back to arbitrum rpc (#12382)

* fix(fmt): always break consistently in calls with opts and args (#12359)

* fix(fmt): always break consistently in calls with opts and args

* more tests

* test: simplify

---------

Co-authored-by: 0xrusowsky <[email protected]>
Co-authored-by: silve K <[email protected]>
Co-authored-by: 0xrusowsky <[email protected]>
@rplusq rplusq mentioned this pull request Oct 31, 2025
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.

feat(fmt): add config to force multi-param structs to not break in a compact manner feat(fmt): multiline_func_header equivalent for events

4 participants