-
Notifications
You must be signed in to change notification settings - Fork 165
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
fix: ordering-rule support for top level statements #393
Conversation
Custom errors can also be at the file-level (that is, outside a contract) and this PR doesn't handle that. |
@fvictorio |
I don't remember, check the implementation. |
Added support for: At File Level:
At Contract Level:
|
uint256 constant oneNiceConstant = 1; | ||
function freeFunction() pure returns (uint256) { | ||
return 1; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@frangio sorry for the ping, but do you have an opinion on this order for file-level nodes? The new supported elements are custom errors, constants and functions.
I feel like I would swap constants and errors here, so that the order is:
- Constants
- Enum/Structs
- Custom errors
- Functions
- Contracts
Bikeshedding though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No opinion here to be honest.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fvictorio I feel the order you proposed is a better one
I changed the weight so it can match what you suggested
Please approve when you have time
This is the #377 with unit tests addition to check the behavior
credits to @pahor167