Comparing version 5.0.1 to 5.0.2
@@ -53,2 +53,3 @@ /* | ||
], | ||
'imports-order': 'warn', | ||
'modifier-name-mixedcase': 'warn', | ||
@@ -55,0 +56,0 @@ 'named-parameters-mapping': 'warn', |
@@ -39,2 +39,6 @@ const BaseChecker = require('../base-checker') | ||
}, | ||
{ | ||
description: 'abi.encodeX call with four UNNAMED parameters', | ||
code: 'abi.encodePacked(_senderAddress, 1e18, _tokenAddress, _receiverAddress )', | ||
}, | ||
], | ||
@@ -71,13 +75,25 @@ bad: [ | ||
if (qtyArgs !== 0) { | ||
if (qtyNamed === 0 && qtyArgs > this.maxUnnamedArguments) { | ||
this.error( | ||
node, | ||
`Named parameters missing. MIN unnamed argumenst is ${this.maxUnnamedArguments}` | ||
) | ||
if (!this.isAbiCall(node)) { | ||
if (qtyArgs !== 0) { | ||
if (qtyNamed === 0 && qtyArgs > this.maxUnnamedArguments) { | ||
this.error( | ||
node, | ||
`Named parameters missing. MIN unnamed arguments is ${this.maxUnnamedArguments}` | ||
) | ||
} | ||
} | ||
} | ||
} | ||
isAbiCall(node) { | ||
if (node.expression.type === 'MemberAccess') { | ||
if (node.expression.expression.type === 'Identifier') { | ||
if (node.expression.expression.name === 'abi') { | ||
return true | ||
} | ||
} | ||
} | ||
} | ||
} | ||
module.exports = FunctionNamedParametersChecker |
@@ -14,2 +14,3 @@ const ConstNameSnakecaseChecker = require('./const-name-snakecase') | ||
const FoundryTestFunctionsChecker = require('./foundry-test-functions') | ||
const ImportsOrderChecker = require('./imports-order') | ||
@@ -31,3 +32,4 @@ module.exports = function checkers(reporter, config) { | ||
new FoundryTestFunctionsChecker(reporter, config), | ||
new ImportsOrderChecker(reporter, config), | ||
] | ||
} |
@@ -23,3 +23,3 @@ const BaseChecker = require('../base-checker') | ||
description: | ||
'Main key of mapping is enforced. On nested mappings other naming are not neccesary', | ||
'Main key of mapping is enforced. On nested mappings other naming are not necessary', | ||
code: 'mapping(address owner => mapping(address => uint256)) public tokenBalances;', | ||
@@ -26,0 +26,0 @@ }, |
{ | ||
"name": "solhint", | ||
"version": "5.0.1", | ||
"version": "5.0.2", | ||
"description": "Solidity Code Linter", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -30,3 +30,3 @@ const linter = require('../../../lib/index') | ||
report, | ||
`Named parameters missing. MIN unnamed argumenst is ${ | ||
`Named parameters missing. MIN unnamed arguments is ${ | ||
minUnnamed < DEFAULT_MIN_UNNAMED_ARGUMENTS ? DEFAULT_MIN_UNNAMED_ARGUMENTS : minUnnamed | ||
@@ -94,3 +94,3 @@ }` | ||
report, | ||
`Named parameters missing. MIN unnamed argumenst is ${DEFAULT_MIN_UNNAMED_ARGUMENTS}` | ||
`Named parameters missing. MIN unnamed arguments is ${DEFAULT_MIN_UNNAMED_ARGUMENTS}` | ||
) | ||
@@ -111,5 +111,5 @@ }) | ||
report, | ||
`Named parameters missing. MIN unnamed argumenst is ${DEFAULT_MIN_UNNAMED_ARGUMENTS}` | ||
`Named parameters missing. MIN unnamed arguments is ${DEFAULT_MIN_UNNAMED_ARGUMENTS}` | ||
) | ||
}) | ||
}) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
466278
229
13504