ZeppelinSolutions / solium-plugin-zeppelin

[DEPRECATED] Solium plugin for Zeppelin audits
MIT License
17 stars 10 forks source link

no-unused-imports doesn't take into account relative paths to the file being analyzed #21

Open come-maiz opened 6 years ago

come-maiz commented 6 years ago

On #17 we found that the no-unused-imports rule tries to read the imported path relative the the directory where the solium command is being executed, not relative to the file currently being analyzed.

That means that if we run solium on a directory root, and there is a file in root/contracts/TestImport.sol with a statement like import './TestImported.sol', we will try to find this file in root/TestImported.sol instead of root/contracts/TestImported.sol.

To fix this, we need a change in solium because the rule currently has no access to the path of the file being analyzed.