mamushi icon indicating copy to clipboard operation
mamushi copied to clipboard

[Bug] Inconsistent treatment of comments

Open johnnyonline opened this issue 1 year ago • 1 comments

Before mamushi .:

event Sweep:
    token: address
    amount: uint256

# ============================================================================================
# Constants
# ============================================================================================

UNIT: constant(uint256) = 10**18

# ============================================================================================
# Storage
# ============================================================================================

After mamushi .:

event Sweep:
    token: address
    amount: uint256


# ============================================================================================
# Constants
# ============================================================================================

UNIT: constant(uint256) = 10**18

# ============================================================================================
# Storage
# ============================================================================================

This extra space below sweep seems off. Or i'd expect those spaces everywhere.

  • mamushi, version 0.0.4

johnnyonline avatar Jan 04 '25 15:01 johnnyonline

Event declarations are followed by two blank lines. You'd get the same thing with black in Python after declaring a class:

class Test(Enum):
    A = 0
    B = 1

# Constant declaration
C = 2

is reformated as:

class Test(Enum):
    A = 0
    B = 1


# Constant declaration
C = 2

UNIT: constant(uint256) = 10**18 is just a variable declaration so the rules for subsequent blank lines are different (simple linebreak if no blank line, one single blank line if multiple blank lines)

benber86 avatar Jan 05 '25 04:01 benber86