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 <grandizzy.the.egg@gmail.com>
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

3 participants