Open aleybovich opened 6 years ago
What is exactly the use case? As solium ignore will be very specific to solium.
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.
Ok, so your use case is only for linting nothing else, correct? That was my question, and I guess you have answered it :)
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).
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;
}
}
@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.
@aleybovich Yeah. Tried also copy pasting the example code in contract with no success.
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?