Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

max-len rule doesn't apply in certain cases #272

Open
BrendanChou opened this issue Aug 26, 2019 · 1 comment
Open

max-len rule doesn't apply in certain cases #272

BrendanChou opened this issue Aug 26, 2019 · 1 comment
Labels
bug Hacktoberfest Hacktoberfest 2019

Comments

@BrendanChou
Copy link

Description
The max-len rule doesn't catch too-long lines in some cases. Notably, it seems to only check the first line of a statement, not any other lines of a multi-line statement.

Steps to reproduce
This section may contain all or a combination of the following:
.soliumrc.json

{
  "extends": "solium:all",
  "plugins": ["security"],
  "rules": {
    "operator-whitespace": 0,
    "mixedcase": 0,
    "no-experimental": 0,
    "lbrace": 0,
    "max-len": ["error", 100],
    "indentation": ["error", 4],
    "quotes": ["error", "double"],
    "arg-overflow": ["warning", 3],
    "error-reason": ["error"],
    "visibility-first": ["error"],
    "linebreak-style": ["error", "unix"],
    "security/enforce-explicit-visibility": ["error"],
    "security/no-block-members": 0,
    "security/no-named-returns": ["error"],
    "security/no-suicide-or-selfdestruct": ["error"],
    "security/no-var": ["error"]
  }
}

Solidity:

Require.that(
    data.length >= NUM_ORDER_BYTES + 100+ 100+ 100+ 100+ 100+ 100+ 100+ 100+ 100+ 100+ 100+ 100+ 100+ 100+ 100+ 100+ 100+ 100+ 100+ 100+ 100+ 100+ 100+ 100+ 100+ 100+ 100+ 100+ 100 + NUM_SIGNATURE_BYTES,
    FILE,
    "Cannot parse signature from data"
);

Expected behavior
Have tested in similar scenarios, it seems that max-len only checks the line length of the first line of the statement (The one with Require.that()

Operating System
Mac OS

Linter version
1.2.4

@duaraghav8
Copy link
Owner

@BrendanChou thanks for reporting, I can confirm that this is an issue in the lint rule itself, so you can expect to face the same regardless of your OS. Added to v1.2.5 todo

@duaraghav8 duaraghav8 added the Hacktoberfest Hacktoberfest 2019 label Oct 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Hacktoberfest Hacktoberfest 2019
Projects
None yet
Development

No branches or pull requests

2 participants