Skip to content

standardising all assignment types#1437

Merged
Janther merged 1 commit intomainfrom
assignment-review
Mar 4, 2026
Merged

standardising all assignment types#1437
Janther merged 1 commit intomainfrom
assignment-review

Conversation

@Janther
Copy link
Member

@Janther Janther commented Mar 2, 2026

After working on #1436 I noticed how there are 4 ways to assign a value to a variable and in each one we have slightly different logic.

// Constant Definition
uint constant FOO_BAR = 0x1234;

contract Foo {
    // State Variable Definition
    uint foo = 0x1234;

    function bar() {
        // Variable Declaration
        uint foobar = 0x5678;

        // Assignment Expression
        foobar = 0xabcd;
    }
}

This is a debt we had since the ANTLR parser.

This PR aims to standardise all of these ways to format the right side of the assignment operator. We did stay as close as possible to the way Prettier formats as well.

@Janther Janther requested a review from fvictorio March 2, 2026 18:20
Copy link
Member

@fvictorio fvictorio left a comment

Choose a reason for hiding this comment

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

This looks good to me, but we should make this a minor release, and clarify in the release notes that there are formatting changes in the name of consistency.

@Janther Janther merged commit 29647cb into main Mar 4, 2026
7 checks passed
@Janther Janther deleted the assignment-review branch March 4, 2026 15:27
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