-
Notifications
You must be signed in to change notification settings - Fork 29
tests: add and follow most of the eslint rules #155
base: master
Are you sure you want to change the base?
Conversation
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.
Thanks Leo! Left some comments, we can discuss this offline with the rest of the time if necessary
function getImplementation(string contractName) public view returns (address) { | ||
function getImplementation(string contractName) | ||
public view returns (address) | ||
{ |
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 don't understand why many lines are being fixed this way when we are working with a max-length of 120 Let's use 120
"quotes": ["error", "double"], | ||
"no-empty-blocks": "off", | ||
"indentation": ["error", 2], | ||
"max-len": ["error", 79], |
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.
let's use 120
"no-debugger": 0, | ||
"no-undef": 2, | ||
"object-curly-spacing": [2, "always"], | ||
"max-len": [2, 120, 2], |
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.
is this rule shadowing the one defined in .soliumrc.json
?
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.
sorry, this is JS... I'd fix .soliumrc.json
to 120
"no-constant": ["error"], | ||
"security/enforce-explicit-visibility": ["error"], | ||
"security/no-block-members": ["warning"], | ||
"security/no-inline-assembly": ["warning"], |
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.
thinking about our Proxy
contract, should we be warned since we are using inline-assembly to delegate calls?
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.
Yes, in this repo it's less useful. I like it because it forces us to have a good reason to use assembly, and we can use it as a reminder to put this good reason in a comment on the code.
I see this as a: WARNING: black magic ahead. Use with caution.
I would leave it because it's just three or four blocks of code, and hopefully it will not grow much, but no strong opinion here.
@facuspagnuolo I have some reasons for 80 chars here: Following the process we defied on #static, we should start using the current rules and in case of disagreement, discuss on the code-style repo. If we agree on 120, later I'll come back and adjust the code. Thanks for reviewing! |
Waiting for the new approach we discussed offline to tackle linter rules |
Requires #154
Brought to you with 🤓 by the #static task force.
Remember that if you have $opinions, you should report an issue on https://github.com/ZeppelinSolutions/code-style where we will discuss about it and then update the rules accordingly, if required.