Git Product home page Git Product logo

solver's Introduction

๐Ÿ”Ž Solver

Solver integrates Solhint (a Solidity linter) in Visual Studio Code.

Learn more about Solhint here.

๐Ÿš€ Usage

Since Solver already contains an instance of Solhint, you are not required to install it. If you are creating a new project from scratch, you can add manually a .solhint.json configuration file (or use Solhint to generate one).

Once installed, the extension will start when you will open a Solidity file.

The way it works is very simple:

  • If you opened a single file: the rules defined in the settings of the extension will be used.
  • If you opened a folder: the extension is going to look for a .solhint.json file in the current workspace and use the rules defined inside this file.

Note: If you did not defined any rule in the settings of the extension, or if the .solhint.json file is missing, all the rules are going to be activated by default.

๐Ÿ”ง Extension Settings

The following settings are available:

solver.delay

When the current file has been edited, this defines how much time (in millisecond) the extension will wait before triggering a new linting. Exemple:

  "solver.delay": 500

solver.warningStyle

The style applied to the warning messages. Example:

"solver.warningStyle": {
  "border": "1px solid #f39c12",
  "borderStyle": "dashed"
}

solver.errorStyle

The style applied to the error messages. Example:

"solver.warningStyle": {
  "border": "1px solid #c0392b",
  "borderStyle": "dashed"
}

solver.config

This defines all the rules related to Solhint. You can simply copy and paste the content of a .solhint.json file in here. Example:

"solver.config": {
  "extends": "solhint:default",
  "plugins": [],
  "rules": {
    "quotes": "warn",
    "const-name-snakecase": "off",
    "avoid-suicide": "error",
    "avoid-sha3": "warn",
    "avoid-tx-origin:": "warn",
    "not-rely-on-time": "warn",
    "not-rely-on-block-hash": "warn",
    "space-after-comma": "warn",
    "no-spaces-before-semicolon": "warn"
  }
}

You can find more details about Solhint rules here.

Note: Plugins are not supported yet.

๐Ÿ› Known Issues

Here are the known issues, I'll try to fix them as soon as possible:

  • When an issue has been spotted, the warning / error message may highlight more code than needed
  • When the rules are updated (in the settings or in the .solhint.json file), the new configuration may not be used right away in the current file
  • Plugins are not supported yet
  • When an issue has been spotted, a solution could be proposed to fix it
  • This extension does not implement Solidity syntax highlighting

solver's People

Contributors

clemlak avatar hackmd-deploy avatar

Watchers

 avatar  avatar  avatar

Forkers

drakeevans

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.