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

Wrong indentation on ternary operator parentheses #276

Open
k06a opened this issue Dec 28, 2019 · 0 comments
Open

Wrong indentation on ternary operator parentheses #276

k06a opened this issue Dec 28, 2019 · 0 comments
Labels

Comments

@k06a
Copy link

k06a commented Dec 28, 2019

Description

Parentheses in ternary operator in array breaks indentation rules:

Steps to reproduce

Source code:

contract A {
    function func(uint256 a, uint256 b, uint256 flags) public view returns(uint256) {
        uint256[4] memory reserves = [
            (flag & 1) == 0 ? a : b,
            (flag & 2) == 1 ? b : a
        ];

        //..
    }
}

Gives:

  42:12     error    Only use indent of 12 spaces.    indentation
  43:12     error    Only use indent of 12 spaces.    indentation

Linter version: 1.2.5

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

No branches or pull requests

1 participant