Socket
Socket
Sign inDemoInstall

solium

Package Overview
Dependencies
190
Maintainers
1
Versions
56
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    solium

Linter to identify and fix Style & Security issues in Solidity


Version published
Weekly downloads
1.2K
decreased by-25.14%
Maintainers
1
Install size
11.8 MB
Created
Weekly downloads
 

Changelog

Source

1.2.2 (2019-01-13)

  • Added support for parsing function declarations inside Inline Assembly blocks.
  • Added Issue Templates to the repository for Bug report, Feature request and Lint rule suggestion.
  • Added Contribution guidelines.
  • Changed .soliumignore-related warning messages to be more user-friendly.
  • Fixed bugs in parser related to Inline Assembly variable declaration.
  • Fixed uppercase rule to allow single-character names, where the character must be an alphabet.
  • Fixed indentation rule to allow Call expression arguments to start with circular bracket (#223).
  • Fixed BinaryExpression position bug in parser that led to #175 & #223.

Readme

Source


Build Status Gitter chat Latest News

Ethlint (Formerly Solium) analyzes your Solidity code for style & security issues and fixes them.

See Documentation, Changelog and upcoming releases.

Install

npm install -g ethlint
solium -V

For backward-compatibility, you can still use npm install -g solium.

If you're currently using the solium package for npm install, it is highly recommended that you move to ethlint. The solium package will not receive updates after April, 2019. There are no differences between the updates pushed to ethlint and solium packages.

Usage

In the root directory of your DApp:

solium --init

This creates 2 files for you:

  • .soliumignore - contains names of files and directories to ignore while linting
  • .soliumrc.json - contains configuration that tells Solium how to lint your project. You should modify this file to configure rules, plugins and sharable configs.

.soliumrc.json looks like:

{
  "extends": "solium:recommended",
  "plugins": ["security"],
  "rules": {
    "quotes": ["error", "double"],
    "indentation": ["error", 4]
  }
}

To know which lint rules Solium applies for you, see Style rules and Security rules.


NOTE

Solium does not strictly adhere to Solidity Style Guide. It aims to promote coding practices agreed upon by the community at large.


Lint

solium -f foobar.sol
solium -d contracts/

Configure with comments

Comment Directives can be used to configure Solium to ignore specific pieces of code. They follow the pattern solium-disable<optional suffix>.

If you only use the directive, Solium disables all rules for the marked code. If that's not desirable, specify the rules to disable after the directive, separated by comma.

  • Disable linting on a specific line
contract Foo {
	/* solium-disable-next-line */
	function() {
		bytes32 bar = 'Hello world';	// solium-disable-line quotes

		// solium-disable-next-line security/no-throw, indentation
						throw;
	}
}
  • Disable linting on entire file
/* solium-disable */

contract Foo {
	...
}

Fix

Solium automatically fixes your code to resolve whatever issues it can.

solium -d contracts/ --fix

Our supporters

Ethereum Augur    Gitcoin

If Ethlint helped make your life simpler, please consider donating ETH to 0xacc661A56af9793a4437876a52F4Ad3fc3C443d6

IDE and Editor Integrations | Documentation | Demo Video

Keywords

FAQs

Last updated on 13 Jan 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc