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

Block comments confuse indentation detection #65

Closed
ulope opened this issue Dec 8, 2016 · 3 comments
Closed

Block comments confuse indentation detection #65

ulope opened this issue Dec 8, 2016 · 3 comments

Comments

@ulope
Copy link

ulope commented Dec 8, 2016

This example causes an (IMO) incorrect indentation warning

pragma solidity ^0.4.4;


contract Something {
    /* blah
     */
    function something(uint a, int b) returns (int c) {
        return a + b;
    }

    /* blah
     */
    function other(uint a, int b) returns (int c) {
        return a + b;
    }
}
In test.sol, line 12:
     */
^-- WARNING: Incorrect indentation: Make sure you use 4 SPACES per level and don't precede the code by any comments.

Interestingly this only happens on the second (and all later) occurrences of a block comment not on the first.

@duaraghav8
Copy link
Owner

duaraghav8 commented Dec 8, 2016

The indentation checker is doing its job alright. Because the */ has 1 extra space before it, the linter throws a warning because it doesn't see exactly 4 spaces (it sees 5 instead).

So I think we need to make an exception for the multi line comment.

EDIT: (I'll also check out why the first block got ignored)

@ulope
Copy link
Author

ulope commented Dec 8, 2016

But strangely the first occurrence is't recognized as a violation.

@duaraghav8 duaraghav8 added the bug label Dec 8, 2016
duaraghav8 pushed a commit that referenced this issue Dec 8, 2016
@duaraghav8
Copy link
Owner

closing this since the above script now gets through without any errors, opening up another todo item to write tests for indentation rule. Thanks for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants