Skip to content

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

@seanoh1989

Description

@seanoh1989

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

  • The command you used to lint
solium -d .
  • The solidity code over which you ran the linter
  1. Files in node_modules
  2. Migrations.sol generated by Truffle
// SPDX-License-Identifier: MIT
pragma solidity >=0.4.22 <0.8.0;

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions