Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Inconsistent treatment of comments #53

Open
johnnyonline opened this issue Jan 4, 2025 · 1 comment
Open

[Bug] Inconsistent treatment of comments #53

johnnyonline opened this issue Jan 4, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@johnnyonline
Copy link

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 johnnyonline added the bug Something isn't working label Jan 4, 2025
@johnnyonline johnnyonline changed the title Inconsistent treatment of comments [Bug] Inconsistent treatment of comments Jan 4, 2025
@benber86
Copy link
Owner

benber86 commented Jan 5, 2025

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants