duaraghav8 / Ethlint

(Formerly Solium) Code quality & Security Linter for Solidity
https://ethlint.readthedocs.io/en/latest/
MIT License
927 stars 128 forks source link

SyntaxError #73

Closed xanderdunn closed 7 years ago

xanderdunn commented 7 years ago

solium 0.2.2

Anytime I attempt to lint the Numeraire contracts, I get this SyntaxError:

$ solium --file contracts/Numeraire_dependencies.sol
An error occurred while running the linter on contracts/Numeraire_dependencies.sol:
Error: An error occured while parsing the source code:
SyntaxError: Expected "!=", "!==", "%", "%=", "&", "&&", "&=", "(", "*", "**", "*=", "+", "++", "+=", ",", "-", "--", "-=", ".", "/", "/*", "//", "/=", ";", "<", "<<", "<<=", "<=", "=", "==", "===", ">", ">=", ">>", ">>=", ">>>", ">>>=", "?", "[", "^", "^=", "in", "instanceof", "|", "|=", "||", comment, end of line or whitespace but "{" found. Line: 130, Column: 93
    at EventEmitter.lint (/Users/admin/.nvm/versions/node/v6.9.2/lib/node_modules/solium/lib/solium.js:88:10)
    at lintString (/Users/admin/.nvm/versions/node/v6.9.2/lib/node_modules/solium/lib/cli.js:126:24)
    at lintFile (/Users/admin/.nvm/versions/node/v6.9.2/lib/node_modules/solium/lib/cli.js:157:9)
    at filesToLint.map.file (/Users/admin/.nvm/versions/node/v6.9.2/lib/node_modules/solium/lib/cli.js:176:45)
    at Array.map (native)
    at lint (/Users/admin/.nvm/versions/node/v6.9.2/lib/node_modules/solium/lib/cli.js:176:33)
    at Object.execute (/Users/admin/.nvm/versions/node/v6.9.2/lib/node_modules/solium/lib/cli.js:287:19)
    at Object.<anonymous> (/Users/admin/.nvm/versions/node/v6.9.2/lib/node_modules/solium/bin/solium.js:11:5)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
No issues found.

The contracts compile fine with solc 0.4.10.

duaraghav8 commented 7 years ago

Thanks for reporting this @xanderdunn

alexstep commented 7 years ago

Maybe you can add something like https://github.com/Latrasis/linter-solidity/blob/master/lib/compiler.js ?

travs commented 7 years ago

Similar issue with solidity-parser was fixed over here, in case solium makes the switch. Also relevant to #58

duaraghav8 commented 7 years ago

Solium has now switched to solidity-parser as dependancy instead of solparse. So this won't give you trouble once v0.5.0 is released (which is very soon :) )