-
Notifications
You must be signed in to change notification settings - Fork 319
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
Add linting for vyper files #52
Conversation
241bc2e
to
07bb6ff
Compare
Not sure why the brownie workflow is failing on the pre-commit hook check (I just reformatted the file). Will look into it at another time. |
cdee4e9
to
9e66129
Compare
Of course, I had to rebase. I consider this ready for review now. |
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.
This is really awesome, thank you! I just have one modification I'd like to see if it's possible to change black
to accept.
Also, in terms of distribution, will you be able to publish to PyPI so we can more officially integrate this into our CI? (through adding another task)
contracts/Vault.vy
Outdated
def name() -> String[42]: view | ||
def symbol() -> String[20]: view | ||
def decimals() -> uint256: view |
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.
Can blackadder
be adjusted to maintain this? I find this much more readable actually (the item after the :
is actually the mutability of the method, not a function body). We don't use classes for anything else, so perhaps this behavior can be monkey-patched
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.
I guess we'd have to patch black's transform_line
or the Line
class. It's doable, but will require some investigation/time
I find this much more readable
agree. And aesthetic
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.
fyi I probably won't be able to look into this until next week
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.
What's weird about this is that Strategy
interface below didn't get updated... 🤔
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.
Not sure I get what you mean, I see Strategy
reformatted below here
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.
Weird, I don't
interface Strategy:
def distributeRewards(_shares: uint256): nonpayable
def estimatedTotalAssets() -> uint256: view
def withdraw(_amount: uint256): nonpayable
def migrate(_newStrategy: address): nonpayable
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.
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.
ah, sorry! that's why that CI keeps failing haha
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.
@fubuloubu for now, I'd suggest to keep this formatting as is, if it's not too much of an inconvenience. We should address these formatting issues in the next major blackadder release but it will take some time until we get that out.
Otherwise, we can postpone this PR until then.
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.
I'd argue we should wait then. This reformatting makes things significantly less clear.
Sure, I should add a step to the blackadder CI so that it automatically pushes on new tags. |
This is now on PyPI, https://pypi.org/project/blackadder/
Shall I replace the |
Yes please! Also if you could make it another task in the Lint config, that'd be awesome! |
f12c1fd
to
e5f66e8
Compare
e5f66e8
to
93c1fb9
Compare
Will have to re-approach after this tool is ready for primetime. Thanks for giving it a shot! |
Fixes #16