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

Having a .solhint.json with custom rules breaks the Solidity compiler server #179

Open
Jaime-Iglesias opened this issue May 23, 2020 · 12 comments

Comments

@Jaime-Iglesias
Copy link

Screenshot from 2020-05-23 19-07-12

I've noticed that my extension was not telling me about errors, like unused parameters and stuff like that, then I noticed the message about the Solidity server crashing.

At first it was complaining about some custom rules that I have (They are for solhint 2.x), then I removed the rules (but left the .solhint.json) then it complained about it being empty. After I completely removed the .solhint.json file it did not stop crashing.

  • Temportal fix: Removing the .solhint.json
@juanfranblanco
Copy link
Owner

Thanks, I have upgraded to solhint 3.0 on the latest release, I did not experienced any issues on my side even using a JSON file... obviously not enough :(

@Jaime-Iglesias
Copy link
Author

Thanks, I have upgraded to solhint 3.0 on the latest release, I did not experienced any issues on my side even using a JSON file... obviously not enough :(

I will try installing the latest solhint version locally and use some custom rules that I already have for 3.0, I'll tell you how that goes :D

@juanfranblanco
Copy link
Owner

juanfranblanco commented May 24, 2020

image
image

@Jaime-Iglesias
Copy link
Author

Jaime-Iglesias commented May 24, 2020

So, after some extra testing I've come to the following conclusions:

  1. The solhint version is not the problem.
  2. Having a .solhint.json is not the problem.
  3. The problem is having custom rules.
  • The error.
    Screenshot from 2020-05-24 12-03-51
  • My .solhint.json file.
    Screenshot from 2020-05-24 12-04-43
  • My package.json
    Screenshot from 2020-05-24 12-05-19

EDIT:

I wonder if this - protofire/solhint#206 - will fix it.

@juanfranblanco
Copy link
Owner

Ah what you meant by custom rules was your plugins, not your specific rules. Yes that needs to be fixed by the solhint guys... the same as before..

@Jaime-Iglesias
Copy link
Author

Ah what you meant by custom rules was your plugins, not your specific rules. Yes that needs to be fixed by the solhint guys... the same as before..

Yeah, the problem is that it now crashes the Solidity Compiler Server which it didn't before :(

@PaulRBerg
Copy link
Contributor

I'm wrestling with a similar issue now, after having recently upgraded to solhint@3.3.4. Some obvious errors are correctly highlighted:

Capture d’écran 2021-04-27 à 16 40 01

But others, such as incorrect types, are not (underlyingOut should be an uint256):

Capture d’écran 2021-04-27 à 16 42 35

This is with vscode-solidity@0.0.113. Deleting .solhint.json didn't fix this.

@juanfranblanco
Copy link
Owner

juanfranblanco commented Apr 27, 2021

@PaulRBerg custom rules are not supported as it needs further work from solhint, mainly a way to inject those custom rules into the plugin. As those rules need to be loaded dynamically and found. Mainly in the user repo or something like that.

@PaulRBerg
Copy link
Contributor

I don't think I am using custom rules. This is my .solhint.json file.

Also the type error above is not triggered by solhint, but the solidity compiler itself.

@juanfranblanco
Copy link
Owner

juanfranblanco commented Apr 28, 2021

Yes you are using the "prettier" plugin @PaulRBerg

@PaulRBerg
Copy link
Contributor

PaulRBerg commented Apr 28, 2021

Ah so that's what you mean by custom rules. Gotcha.

Tagging @fvictorio (creator of the prettier plugin), in case he knows how to patch this.

@juanfranblanco
Copy link
Owner

@PaulRBerg we have some thread there protofire/solhint#206

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants