-
Notifications
You must be signed in to change notification settings - Fork 160
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
Support for Solidity 0.6.x #170
Comments
Hi @christianparpart, I'm very glad Solhint has been useful to you! We are in the middle of some work towards Solhint 3.0. One of the things that will come out of it is that we are going to leverage That being said, we are considering deprecating the style rules and delegating this to |
Hm, the solidity-parser-antlr project isn't maintained by us, so you make yourself depending on an external project where you are not in control how long it will take them to adapt with syntax changes. I am not sure that this will speed up adaptability. With regard to the other: using a solhint plugin in our CI shouldn't be of any issues. |
Oh, sure, but Federico has done an excellent job so far, and AFAIK he's just adding a thin abstraction over the antlr grammar we are using directly right now. If at some point he doesn't maintain it anymore, it should be forkable since it's MIT licensed. (ccing @federicobond since he might be interested on this discussion). |
I don't know if this makes complete sense, as some people may want a linting and not code formatting tool, but for users of prettier (including me), forcing more people to use the prettier plugin seems like a good idea to mature that plugin :). I guess it's a question of what we'd consider style, as almost everything outside of the |
I think this should be doable with a plugin. I personally would love to see someone working on that. The problem is that style rules are hard and we prefer to use that effort in other stuff.
I think pretty much anything that doesn't change the AST is a style rule. If that means that solhint's core will only have security rules, that seems like a sensible choice to me. |
Is there an estimate for when 3.0 will be released? Sadly 0.6's new keywords (abstract, virtual, receive, etc.) completely break solhint, making it unusable :( |
Hi @nventuro! We want to release 3.0 as soon as possible. We have some pending things, but the main blocker is a situation with In the meantime, I think we can publish a release candidate to npm, and you can use that to start the migration. Plus, we would love the feedback you could give us. Do you think that would help? |
Sure! We don't use try/catch yet, so if that's the only missing feature on an rc I'd love to give it a go. |
Cool, I'll try to publish it tomorrow. Will let you know as soon as it's available. |
@nventuro you should be able to try the new version with |
Thanks @fvictorio! The new version is able to correctly parse my 0.6 code, but I get a new warning that didn't show up when using 2.3: it looks like a linter bug. Other than this, everything seems to be working fine! Given an override like the following, where not all function arguments are used: function withdrawalAllowed(address) public view override returns (bool) {
return _state == State.Refunding;
} I get the following warning:
|
Wow, that's weird. I'll take a look into it, thanks! And by the way, a heads up: we are removing all the styling rules in 3.0. We might move them to a plugin, or let the community do it, but we've found that they take a lot of work to maintain and we want to focus more in the best practices and security rules. Just letting you know because I saw that you are using a couple of them (maybe we should emit a warning when the config has a rule that doesn't exist?) |
Sounds good!
This is a great idea, yes! |
@nventuro Fixed that in By the way, with respect to the styling, have you guys considered using Plus, you can use it along with solhint (well, not in 3.0, but that's an easy fix). |
Thanks for the suggestion! What needs to be done to have it working on 3.0? |
Mainly upgrading the parser in |
Great, thanks! Let me know when you want for me to give it a try with 0.6. |
Solidity v0.6.4 deprecated the As an example, the following statement: (bool success, ) = recipient.call.value(amount)(""); Should now be written as: (bool success, ) = recipient.call{value: amount}(""); |
Thanks @nventuro. I opened an issue in the parser's repo for this. |
Hi, how safe is to upgrade vscode to use the RC version of solium? |
I think it's pretty safe, and in fact it would help us a lot to validate the RC. We haven't released as a stable version mainly because docs are not completely up to date, but functionality-wise it should be pretty much ready. |
Keep in mind Consensys/solidity-parser-antlr#14 is still open, so if you're using that syntax the linter will crash :/ We're keeping OpenZeppelin/openzeppelin-contracts#2115 unmerged because of that. |
Aghh, that's really frustrating. I'll try to make a PR for that this weekend. |
@fvictorio the latest rc (3.0.0-rc.7) parses the new For example, the following code function _asyncTransfer(address dest, uint256 amount) internal virtual {
_escrow.deposit{ value: amount }(dest);
} errors out with
|
@nventuro This should be fixed in |
Thanks everyone for the feedback! I'm going to close this issue to keep things organized. Please open a new issue if something else shows up, or if something in this thread wasn't fixed. |
Hi,
first, many thanks for this great too. We're using solhint in our own CI @ solidity to check the Solidity source code within the Solidity documentation.
Now, the 0.6.0 release is around the corner, and our CI is failing due to some of the new features being implemented.
See: https://solidity.readthedocs.io/en/develop/060-breaking-changes.html#new-features
From what I can tell, at least the new try/catch for external calls is missing the implementation part on solhint-side.
Many thanks,
Christian Parpart.
The text was updated successfully, but these errors were encountered: