Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/duaraghav8/Ethlint
(Formerly Solium) Code quality & Security Linter for Solidity
https://github.com/duaraghav8/Ethlint
ethereum lint security smart-contracts solidity
Last synced: 14 days ago
JSON representation
(Formerly Solium) Code quality & Security Linter for Solidity
- Host: GitHub
- URL: https://github.com/duaraghav8/Ethlint
- Owner: duaraghav8
- License: mit
- Created: 2016-08-05T14:07:13.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-04-17T09:42:36.000Z (over 1 year ago)
- Last Synced: 2024-06-17T05:28:34.094Z (5 months ago)
- Topics: ethereum, lint, security, smart-contracts, solidity
- Language: JavaScript
- Homepage: https://ethlint.readthedocs.io/en/latest/
- Size: 1.65 MB
- Stars: 920
- Watchers: 23
- Forks: 124
- Open Issues: 73
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- awesome-smart-contracts - duaraghav8/Solium - A customizable, stand-alone linter for Ethereum Solidity. (Utilities / Audits)
- awesome-solidity - duaraghav8/Ethlint - Linter to identify and fix style & security issues in smart contracts. (Tools)
- awesome-solidity - duaraghav8/Ethlint - Linter to identify and fix style & security issues in smart contracts. (Tools)
- awesome-web3-tools-and-dapps - Ethlint - Ethlint, previously known as Solium, examines your Solidity code to identify any problems regarding style and security and then resolves them. (dApps directory / Static Analysis Tools)
- awesome-solidity - duaraghav8/Ethlint - Linter to identify and fix style & security issues in smart contracts. (Tools)
- DeFi-Developer-Road-Map - Ethlint - Linter to identify and fix style & security issues in Solidity, formerly Solium (Roadmap)
README
[![Build Status](https://travis-ci.org/duaraghav8/Ethlint.svg?branch=master)](https://travis-ci.org/duaraghav8/Ethlint)
[![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.svg)](https://gitter.im/Solium-linter/Lobby)Ethlint (Formerly Solium) analyzes your Solidity code for style & security issues and fixes them.
See [Documentation](https://ethlint.readthedocs.io/), [Changelog](./CHANGELOG.md) and [upcoming releases](https://github.com/duaraghav8/Ethlint/projects).
Before beginning to work on a contribution, please read the [Guidelines](./CONTRIBUTING.md).
## Install
```bash
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:
```bash
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:
```json
{
"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](http://ethlint.readthedocs.io/en/latest/user-guide.html#list-of-style-rules) and [Security rules](https://www.npmjs.com/package/solium-plugin-security#list-of-rules).
---
**NOTE**Solium does **not** strictly adhere to Solidity [Style Guide](http://solidity.readthedocs.io/en/latest/style-guide.html). It aims to promote coding practices agreed upon by the community at large.
---
### Lint
```bash
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`.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.
```bash
solium -d contracts/ --fix
```## Our supporters
If Ethlint helped make your life simpler, please consider donating ETH to `0xacc661A56af9793a4437876a52F4Ad3fc3C443d6`
#### [IDE and Editor Integrations](http://solium.readthedocs.io/en/latest/user-guide.html#index-9) | [Documentation](https://ethlint.readthedocs.io) | [Demo Video](https://www.youtube.com/watch?v=MlQ6fzwixpI)