Skip to content

Standard configuration for linting Solidity code using ethlint/Solium.

Notifications You must be signed in to change notification settings

keep-network/solium-config-keep

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

solium-config-keep

Standard configuration for linting Solidity code using ethlint/Solium. Uses the solium:recommended ruleset, which itself is taken from the Solidity Style Guide.

Installation

npm i https://github.com/keep-network/solium-config-keep.git

Usage

Setting up a project

  1. Install the linter and config - npm i -D ethlint https://github.com/keep-network/solium-config-keep.git
  2. Create your .soliumrc.json:
{
 "extends": "keep",
 "plugins": [
   "security"
 ]
}
  1. Add commands for linting to your package.json:
{
 "scripts": {
   "sol:lint": "solium -d contracts/",
   "sol:lint:fix": "solium -d contracts/ --fix"
 }
}

Disabling the linter

Directory

Edit the .soliumrc.json.

File

/* solium-disable */

Code block

/* solium-disable */ /* solium-enable */

Line

Prefer /* over //, as it looks different to a comment on the rationale of code.

/* solium-disable-next-line <rules> */ /* solium-disable-previous-line <rules> */

Adding a pre-commit hook

- repo: local
   hooks:
    - id: solium
      name: Solidity linter
      language: node
      entry: solium
      files: '\.sol$'
      args:
      - --dir=./contracts/
      - --config=./.soliumrc.json
      additional_dependencies:
      - ethlint@1.2.3

About

Standard configuration for linting Solidity code using ethlint/Solium.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •