• Stars
    star
    908
  • Rank 50,302 (Top 1.0 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 8 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

(Formerly Solium) Code quality & Security Linter for Solidity


Build Status Gitter chat

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

See Documentation, Changelog and upcoming releases.

Before beginning to work on a contribution, please read the Guidelines.

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 December, 2019. There are no differences between the updates pushed to ethlint and solium packages.

Usage

In the root directory of your DApp, run:

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],
    "linebreak-style": ["error", "unix"]
  }
}

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

More Repositories

1

solium-plugin-security

The Official Security Plugin for Ethlint (formerly Solium)
JavaScript
44
star
2

solparse

Solidity Parser for Solium
JavaScript
30
star
3

SwarmOpt

A Library for Particle Swarm Optimization
C++
18
star
4

Linkedin-Mass-Add

Automatically keep adding people on Linkedin on the search results by simulating the clicking of all those blue-colored "connect" buttons
JavaScript
15
star
5

soltar

Generate Solidity Code from its AST
JavaScript
14
star
6

Corque

Face Recognition System for automatic attendance marking @ our college
Python
11
star
7

matrix-parser

Node.js middleware for parsing Matrix URIs
JavaScript
8
star
8

dapp-workflow

Material for my Ethereum Development Workshop
JavaScript
7
star
9

N-Puzzle-through-A-Star

Solving the N-Puzzle Using A Star Search Algorithm with Manhattan Heuristic
Python
6
star
10

sol-explore

Traversal functions for solidity-parser generated AST
JavaScript
5
star
11

Particle-Swarm-Optimization

I'm experimenting with the different parameters in gbest & lbest PSO Algorithms to tweak the exploration process.
Python
5
star
12

Hackerrank-Problems

Problems I solved on Hackerrank - This repo is for my own reference and evaluation but feel free to check it out.
Python
5
star
13

XSS

Information Security Project to demonstrate Cross Site Scripting vulnerabilities (Persistent, Reflected)
CSS
5
star
14

Autoconfig

Automate the manual process of IP and DNS Configuration, which is required at some places whose network can only be accessed via static IP address
C++
4
star
15

dignet

Go library and CLI tool to find available subnets in Amazon VPC
Go
4
star
16

solmeister

AST traversal-based code editing for Solidity
JavaScript
4
star
17

embark-solium

Ethlint (formerly Solium) plugin for Embark Framework
JavaScript
4
star
18

okta-admin

Commandline application to perform administrative tasks in Okta
Go
4
star
19

Security

This repository consists of tutorials useful for understanding beginner level exploitation, OS architectures and Security in General.
C
3
star
20

Android

Android Hacks
Java
3
star
21

ethereum-snippets

This repo probably serves as better documentation than the official Solidity & Web3 docs
3
star
22

datadog-monitor-downtime

Schedule and Cancel datadog monitor downtimes
Python
3
star
23

Random-Programs

Miscellaneous Code snippets
Python
2
star
24

Genetic

Genetic Algoithms and Genetic Programming
Python
2
star
25

DabbleChat

An anonymous real time chat system I developed for use at college after I realized that the usual chat based apps weren't quite effective in the area due to bad internet connectivity over phone. Though it was intended as a fun project, this simple-looking chat app went viral on my College Network (it only enjoyed the fame for 3 days though).
PHP
2
star
26

LILY

Lion Identification Loss less Yield or LILY is a Digital Image Processing based Software Project developed for Scientists at the Wildlife Institute of India (WII) for the purpose of conducting Lion Census.
Python
2
star
27

MailGriller

[NOTE: I no longer maintain this repo] If you own a business and you need to send an email to all your clients or maybe mass market, then you are familiar with services like MailChimp. I am building an open source alternative to these services.
Python
2
star
28

fabric-scripts

Server automation scripts built with Fabric
Python
1
star
29

ethereum-dapp-flow

Illustrates solidity contract workflow from first principles
JavaScript
1
star
30

SRE101

All code for SRE101 - a channel about all things DevOps & Reliability
Shell
1
star
31

Gullak

My entry to ICICI Appathon '16
JavaScript
1
star
32

Limetray-Assignment

A simple E-Commerce Website based in NodeJS+Angular+Bootstrap. All product resides in memory as JSON, Mongo has been used for User Credentials.
JavaScript
1
star
33

MySQL-CPP-Integration

Connect to and manipulate your MySQL Database through C / C++ (Windows + Ubuntu)
C++
1
star
34

solmap

create a JSON representation of Solidity's import hierarchy
JavaScript
1
star
35

gophercises

I'm learning Go. Look away.
Go
1
star
36

opengl-assignments

Lab Assignments for Computer Graphics using OpenGL (Unix env)
C++
1
star
37

Duncheon

I founded Duncheon in 9th grade because I loved taking up software project contracts.The applications found in this repository are some of the projects I (sometimes along with other coder friends) programmed. These are the projects for which I was able to get permission for making them open source from clients.
PHP
1
star
38

larry-crawler

Kayako Twitter challenge
JavaScript
1
star
39

ML

Code I wrote in order to illustrate Machine Learning Algorithms using input features in mostly 2 dimensional space (could easily be extended to any number of dimensions, its just the visualization that becomes harder which is why I didn't go beyond 2). The code is intended to make developers understand how learners based on Neural Networks, Bayesian learning, Decision Trees and Nearest Neighbor algorithms actually work.
Python
1
star
40

network-tree

Node Module to generate a Network's sitemap in json formats compliant with various graph visualization libraries (like D3, Sigma)
JavaScript
1
star