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

Add support for .soliumignore #76

Open
aleybovich opened this issue Jun 17, 2018 · 7 comments
Open

Add support for .soliumignore #76

aleybovich opened this issue Jun 17, 2018 · 7 comments

Comments

@aleybovich
Copy link

I want to ignore one of the sol files in my project (autogenerated flat file generated by truffle-flattener) and currently, there is no way to do that as adding .soliumignore seems to have no effect. Is there any way you could add support for it?

@juanfranblanco
Copy link
Owner

What is exactly the use case? As solium ignore will be very specific to solium.

@aleybovich
Copy link
Author

Your plugin supports solium and solhint, right? For ignoring files Solium uses .soliumignore and Solhint uses .solhintignore. Can you make sure that if one of those files (depending on what i configure as solidity linter in VS Code) is present in the project, it will be respected?

A use case would be ignoring an autogenerated solidity file generated by truffle-flattener. This file causes lots of lint errors (indentation is 2 spaces in truffle libraries vs 4 spaces in my code, which is default for linters) and I want this file to be ignored when running the linter as a build step.

@juanfranblanco
Copy link
Owner

Ok, so your use case is only for linting nothing else, correct? That was my question, and I guess you have answered it :)

@aleybovich
Copy link
Author

My use case is for both linting in the console (manually running a linter on the project) and error display in VS Code (I don't want to see lint errors in the excluded sol file when I open it).

@crisgarner
Copy link

crisgarner commented Jul 28, 2018

Another use case would be to ignore the solidity tests of truffle. Currently the imports:

import "truffle/DeployedAddresses.sol";
import "truffle/Assert.sol";

Shows the error "Source not found", from what I understand these files are created on runtime, so the compiler shows the error.

Even thought, for this error in particular with truffle, support for Solium Comment Directives to ignore specific pieces of code would be a better approach. An example from the Solium documentation:

contract Foo {
	/* solium-disable-next-line */
	function() {
		bytes32 bar = 'Hello world';	// solium-disable-line quotes

		// solium-disable-next-line security/no-throw, indentation
						throw;
	}
}

@aleybovich
Copy link
Author

@crisgarner - have you actually tried using solium comment directives? I've been using them to hide warnings for things like online assembly and that works well. Haven't tried them for unresolved dependencies though.

@crisgarner
Copy link

@aleybovich Yeah. Tried also copy pasting the example code in contract with no success.

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

No branches or pull requests

3 participants