Git Product home page Git Product logo

solium-plugin-zeppelin's People

Contributors

come-maiz avatar facuspagnuolo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

solium-plugin-zeppelin's Issues

[Fatal error] No such rule exists: all-state-variables-private

Everything works like a charm except for that rule. Haven't looked into it, letting you guys know.

Thanks :)

✖ [Fatal error] An error occurred while linting over contract.sol: "zeppelin/all-state-variables-private" - No such rule exists.

If I take it out, the others work well.

Fails when analyzing a directory

I tried running solium using this plugin within zeppelin-solidity and I get:

✖ [Fatal error] An error occurred while linting over .../zeppelin-solidity/contracts/Bounty.sol: ENOENT: no such file or directory, open './payment/PullPayment.sol'

Steps to reproduce

  1. git clone [email protected]:OpenZeppelin/zeppelin-solidity.git
  2. git clone [email protected]:elopio/solium-plugin-zeppelin.git
  3. npm install -g solium
  4. cd solium-plugin-zeppelin
  5. npm install --dev
  6. npm link
  7. npm link solium-plugin-zeppelin
  8. cd ../zeppelin-solidity
  9. vim .soliumrc.json (replace file's content with the one bellow)
  10. solium -d contracts

Configuration file

{
  "extends": "solium:all",
  "plugins": ["security","zeppelin"],
  "rules": {
    "quotes": ["error", "double"],
    "indentation": ["error", 2],
    "arg-overflow": ["warning", 3],
    "security/enforce-explicit-visibility": ["error"],
    "security/no-block-members": ["warning"],
    "security/no-inline-assembly": ["warning"],
    "zeppelin/constant-candidates": ["warning"],
    "zeppelin/highlight-comments": ["warning"],
    "zeppelin/missing-natspec-comments": ["warning"],
    "zeppelin/no-arithmetic-operations": ["warning"],
    "zeppelin/no-state-variable-shadowing": ["warning"],
    "zeppelin/no-unchecked-send": ["warning"],
    "zeppelin/no-unused-imports": ["warning"]
  }
}

The checks for static errors are not consistent

On the tests for the rules, when we expect an error we check that the return value is an array and that it contains one element. Some times we check the error message, and some other times we don't. But this is not really following any rules.

For each possible error message, we should check the string once. Some other tests variations are ok just checking that there is an error, but the current way to check for that is ugly and repeated many times. It could be a common helper.

Possible EventEmitter memory leak on no-unchecked-send

I tried running the no-unchecked-send rule on the zeppelin-solidity project, and it reported:

(node:8223) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 CallExpression listeners added. Use emitter.setMaxListeners() to increase limit

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

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.

Warn on function shadowing

We have the rule no-state-variable-shadowing, that warns when a child contract redefines a variable from the parent contract.

@facuspagnuolo suggest to extend it to warn also when function are overwritten, which would require just a little more code, reusing the same rule.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.