-
Notifications
You must be signed in to change notification settings - Fork 165
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
af1c996
commit 7bb8a28
Showing
14 changed files
with
603 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"extends": "solhint:all" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity >=0.6.0; | ||
|
||
contract Foo { | ||
uint256 public constant test1 = 1; | ||
uint256 TEST2; | ||
|
||
constructor() { | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity >=0.5.8; | ||
|
||
contract Foo { | ||
uint256 public constant test1 = 1; | ||
|
||
constructor() { | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity >=0.5.8; | ||
|
||
contract Foo { | ||
uint256 public constant TEST1 = 1; | ||
uint256 public value; | ||
|
||
function _goodContract() private { | ||
value = TEST1; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
const foo1Output = [ | ||
{ | ||
line: 2, | ||
column: 1, | ||
severity: 'Error', | ||
message: 'Compiler version >=0.6.0 does not satisfy the ^0.5.8 semver requirement', | ||
ruleId: 'compiler-version', | ||
fix: null, | ||
filePath: 'contracts/Foo.sol', | ||
}, | ||
{ | ||
line: 5, | ||
column: 5, | ||
severity: 'Warning', | ||
message: 'Constant name must be in capitalized SNAKE_CASE', | ||
ruleId: 'const-name-snakecase', | ||
fix: null, | ||
filePath: 'contracts/Foo.sol', | ||
}, | ||
{ | ||
line: 6, | ||
column: 5, | ||
severity: 'Warning', | ||
message: 'Explicitly mark visibility of state', | ||
ruleId: 'state-visibility', | ||
fix: null, | ||
filePath: 'contracts/Foo.sol', | ||
}, | ||
{ | ||
line: 6, | ||
column: 5, | ||
severity: 'Warning', | ||
message: "'TEST2' should start with _", | ||
ruleId: 'private-vars-leading-underscore', | ||
fix: null, | ||
filePath: 'contracts/Foo.sol', | ||
}, | ||
{ | ||
line: 6, | ||
column: 5, | ||
severity: 'Warning', | ||
message: 'Variable name must be in mixedCase', | ||
ruleId: 'var-name-mixedcase', | ||
fix: null, | ||
filePath: 'contracts/Foo.sol', | ||
}, | ||
{ | ||
line: 8, | ||
column: 5, | ||
severity: 'Warning', | ||
message: | ||
'Explicitly mark visibility in function (Set ignoreConstructors to true if using solidity >=0.7.0)', | ||
ruleId: 'func-visibility', | ||
fix: null, | ||
filePath: 'contracts/Foo.sol', | ||
}, | ||
{ | ||
line: 8, | ||
column: 19, | ||
severity: 'Warning', | ||
message: 'Code contains empty blocks', | ||
ruleId: 'no-empty-blocks', | ||
fix: null, | ||
filePath: 'contracts/Foo.sol', | ||
}, | ||
] | ||
|
||
const foo2Output = [ | ||
{ | ||
line: 5, | ||
column: 5, | ||
severity: 'Warning', | ||
message: 'Constant name must be in capitalized SNAKE_CASE', | ||
ruleId: 'const-name-snakecase', | ||
fix: null, | ||
filePath: 'contracts/Foo2.sol', | ||
}, | ||
{ | ||
line: 7, | ||
column: 5, | ||
severity: 'Warning', | ||
message: | ||
'Explicitly mark visibility in function (Set ignoreConstructors to true if using solidity >=0.7.0)', | ||
ruleId: 'func-visibility', | ||
fix: null, | ||
filePath: 'contracts/Foo2.sol', | ||
}, | ||
{ | ||
line: 7, | ||
column: 19, | ||
severity: 'Warning', | ||
message: 'Code contains empty blocks', | ||
ruleId: 'no-empty-blocks', | ||
fix: null, | ||
filePath: 'contracts/Foo2.sol', | ||
}, | ||
] | ||
|
||
module.exports = { foo1Output, foo2Output } |
Oops, something went wrong.