duaraghav8 / Ethlint

(Formerly Solium) Code quality & Security Linter for Solidity
https://ethlint.readthedocs.io/en/latest/
MIT License
926 stars 128 forks source link

.soliumignore doesn't ignore files/dirs listed #287

Open seanoh1989 opened 3 years ago

seanoh1989 commented 3 years ago

Description I have setup ethlint with ethlint --init and made sure .soliumignore has been created. Currently it has

node_modules
src/contracts/Migrations.sol

However, when I run solium -d ., it detects ALL kinds of errors from files in node_modules. It also does not ignore the default Migrations.sol file I have with 2 spaces as indents.

Example

solium -d src\contracts

src\contracts\Migrations.sol
  5:2     error    Only use indent of 4 spaces.    indentation
  6:2     error    Only use indent of 4 spaces.    indentation
  8:2     error    Only use indent of 4 spaces.    indentation
  10:6    error    Only use indent of 8 spaces.    indentation
  11:6    error    Only use indent of 8 spaces.    indentation
  14:0    error    Only use indent of 4 spaces.    indentation
  16:2    error    Only use indent of 4 spaces.    indentation
  18:0    error    Only use indent of 4 spaces.    indentation

Steps to reproduce

contract Migrations { address public owner = msg.sender; uint public last_completed_migration;

modifier restricted() {
    require(
        msg.sender == owner,
        "This function is restricted to the contract's owner"
    );
    _;
}

function setCompleted(uint completed) public restricted {
    last_completed_migration = completed;
}

}


- Contents of your `.soliumrc.json` file

{ "extends": "solium:all", "plugins": ["security"], "rules": { "arg-overflow": "off", "blank-lines": "off", "error-reason": "off", "indentation": ["error", 4], "lbrace": "off", "linebreak-style": ["error", "unix"], "max-len": ["error", 120], "no-constant": ["error"], "no-empty-blocks": "off", "quotes": ["error", "double"], "uppercase": "off", "visibility-first": "error",

"security/enforce-explicit-visibility": ["error"],
"security/no-block-members": ["warning"],
"security/no-inline-assembly": ["warning"]

} }

- Contents of your `.soliumignore`

node_modules src/contracts/Migrations.sol


**Expected behavior**
It should ignore all files and directories listed in `.soliumignore`

**Operating System**
Windows 10

**Linter version**

Solium version 1.2.5



**Comments**
I changed `.soliumignore` to have `src\contracts\Migrations.sol` just in case (since Windows uses `\` instead of `/`), but it doesn't work either.

**Priority**
High - I really want to be able to run this often, without specifying files I worked on.