Repository: protofire/solhint (js)

Issue:
mark-callable-contracts rule is firing a false positive on enums 
The mark-callable-contracts rule is being triggered against enums (similar to #114 and #118).

Simple contract to reproduce the issue:
```
pragma solidity 0.5.9;

contract Example {

    enum Status { Initial }

    Status public status;

    constructor() public {
        status = Status.Initial;
    }
  
}
```

Produces the following warnings:
```
10:18  warning  Explicitly mark all external contracts as trusted or untrusted  mark-callable-contracts
10:25  warning  Explicitly mark all external contracts as trusted or untrusted  mark-callable-contracts
```

Pull request description:
fix #133: do not trigger mark-callable-contracts on enums
I have added enum definitions and values to the `nonContractNames` list.

Patch:
diff --git a/lib/rules/security/mark-callable-contracts.js b/lib/rules/security/mark-callable-contracts.js
index 148fd8b..2a77bcf 100644
--- a/lib/rules/security/mark-callable-contracts.js
+++ b/lib/rules/security/mark-callable-contracts.js
@@ -36,6 +36,15 @@ class MarkCallableContractsChecker {
     this.gatherNonContractNames(ctx)
   }
 
+  enterEnumDefinition(ctx) {
+    this.gatherNonContractNames(ctx)
+  }
+
+  enterEnumValue(ctx) {
+    const enumValue = ctx.getText()
+    this.nonContractNames.push(enumValue)
+  }
+
   exitStateVariableDeclaration(ctx) {
     const hasConstModifier = ctx.children.some(i => i.getText() === 'constant')
 


Test patch:
diff --git a/test/rules/security/mark-callable-contracts.js b/test/rules/security/mark-callable-contracts.js
index fbcc6e4..86e2a70 100644
--- a/test/rules/security/mark-callable-contracts.js
+++ b/test/rules/security/mark-callable-contracts.js
@@ -87,4 +87,20 @@ describe('Linter - mark-callable-contracts', () => {
 
     assert.equal(report.warningCount, 0)
   })
+
+  it('should not return error for enum', () => {
+    const code = contractWith(`
+  enum Status { Initial }
+
+  function b() public view returns(Status) {
+    return Status.Initial;
+  }
+    `)
+
+    const report = linter.processStr(code, {
+      rules: { 'mark-callable-contracts': 'warn' }
+    })
+
+    assert.equal(report.warningCount, 0)
+  })
 })