From f98dc798da05e5c91df82ab67501d8ff31be03f0 Mon Sep 17 00:00:00 2001 From: gitpusha Date: Mon, 2 Nov 2020 18:26:30 +0100 Subject: [PATCH] chore: solhint glob --- .solhint.json | 29 +++++++++++++++---- .../ConnectGelatoDataForFullRefinance.sol | 6 +++- .../ConnectGelatoDataForPartialRefinance.sol | 9 ++++-- package.json | 3 +- 4 files changed, 38 insertions(+), 9 deletions(-) diff --git a/.solhint.json b/.solhint.json index b979090..ef0ef3f 100644 --- a/.solhint.json +++ b/.solhint.json @@ -3,10 +3,17 @@ "plugins": ["prettier"], "rules": { "prettier/prettier": "error", - "code-complexity": ["warn", 5], - "function-max-lines": ["warn", 40], - "max-states-count": ["warn", 3], + "code-complexity": ["error", 5], + "function-max-lines": ["error", 40], + "max-line-length": ["error", 100], + "max-states-count": ["error", 3], + "no-empty-blocks": "error", + "no-unused-vars": "error", + "payable-fallback": "off", "reason-string": ["off", {"maxLength": 32}], + "constructor-syntax": "off", + "comprehensive-interface": "off", + "quotes": ["error", "double"], "const-name-snakecase": "error", "contract-name-camelcase": "error", "event-name-camelcase": "error", @@ -15,13 +22,25 @@ "modifier-name-mixedcase": "error", "private-vars-leading-underscore": ["error", {"strict": false}], "var-name-mixedcase": "error", - "ordering": "warn", + "imports-on-top": "error", + "ordering": "error", "visibility-modifier-order": "error", "avoid-call-value": "off", "avoid-low-level-calls": "off", - "compiler-version": ["warn", "0.7.4"], + "avoid-sha3": "error", + "avoid-suicide": "error", + "avoid-throw": "error", + "avoid-tx-origin": "off", + "check-send-result": "error", + "compiler-version": ["error", "0.7.4"], + "mark-callable-contracts": "off", "func-visibility": ["error", {"ignoreConstructors": true}], + "multiple-sends": "error", + "no-complex-fallback": "error", "no-inline-assembly": "off", + "not-rely-on-block-hash": "error", + "not-rely-on-time": "error", + "reentrancy": "error", "state-visibility": "error" } } diff --git a/contracts/contracts/connectors/ConnectGelatoDataForFullRefinance.sol b/contracts/contracts/connectors/ConnectGelatoDataForFullRefinance.sol index 0ee8b7e..b3c59ea 100644 --- a/contracts/contracts/connectors/ConnectGelatoDataForFullRefinance.sol +++ b/contracts/contracts/connectors/ConnectGelatoDataForFullRefinance.sol @@ -119,6 +119,8 @@ contract ConnectGelatoDataForFullRefinance is ConnectorInterface { ); } + /* solhint-disable function-max-lines */ + /// @notice Generate Task for a full refinancing between Maker to Compound. /// @param _vaultId Id of the unsafe vault of the client. /// @param _token vault's col token address . @@ -176,7 +178,7 @@ contract ConnectGelatoDataForFullRefinance is ConnectorInterface { ); } - /// @notice Generate Task for a full refinancing between Maker (exemple : ETH-A) to Maker (exemple: ETH-B). + /// @notice Generate Task for a full refinancing between Maker e.g. ETH-A to ETH-B. /// @param _vaultId Id of the unsafe vault of the client. /// @param _token vault's col token address . /// @param _colType colType of the new vault, exemple : ETH-B, ETH-A. @@ -236,4 +238,6 @@ contract ConnectGelatoDataForFullRefinance is ConnectorInterface { abi.encode(_targets, _datas) ); } + + /* solhint-enable function-max-lines */ } diff --git a/contracts/contracts/connectors/ConnectGelatoDataForPartialRefinance.sol b/contracts/contracts/connectors/ConnectGelatoDataForPartialRefinance.sol index 32defe1..4e55fd5 100644 --- a/contracts/contracts/connectors/ConnectGelatoDataForPartialRefinance.sol +++ b/contracts/contracts/connectors/ConnectGelatoDataForPartialRefinance.sol @@ -120,6 +120,8 @@ contract ConnectGelatoDataForPartialRefinance is ConnectorInterface { ); } + /* solhint-disable function-max-lines */ + /// @notice Generate Task for a full refinancing between Maker to Compound. /// @param _payload contain : // @param _vaultId Id of the unsafe vault of the client. @@ -198,7 +200,7 @@ contract ConnectGelatoDataForPartialRefinance is ConnectorInterface { ); } - /// @notice Generate Task for a full refinancing between Maker (exemple : ETH-A) to Maker (exemple: ETH-B). + /// @notice Generate Task for a full refinancing between Maker e.g. ETH-A and ETH-B. /// @param _payload contain : // @param _vaultId Id of the unsafe vault of the client. // @param _token vault's col token address . @@ -289,7 +291,8 @@ contract ConnectGelatoDataForPartialRefinance is ConnectorInterface { /// e.g. Maker's ETH/USD oracle for ETH collateral pricing. /// @param _oraclePayload The data for making the staticcall to the oracle's read /// method e.g. the function selector of MakerOracle's read function. - /// @return wDaiDebtToMove DAI Debt (wad) to: flashBorrow->repay Maker->withdraw from B->flashPayback. + /// @return wDaiDebtToMove DAI Debt (wad) to: + /// flashBorrow->repay Maker->withdraw from B->flashPayback. /// @return wColToWithdrawFromMaker (wad) to: withdraw from Maker and deposit on B. /// @return gasFeesPaidFromCol Gelato automation-gas-fees paid from user's collateral // solhint-disable function-max-lines @@ -352,4 +355,6 @@ contract ConnectGelatoDataForPartialRefinance is ConnectorInterface { wDaiDebtOnMaker ); } + + /* solhint-enable function-max-lines */ } diff --git a/package.json b/package.json index 3f82f6f..c04ecc3 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "compile": "npx hardhat compile", "format": "prettier --write .", "lint": "eslint --cache . && yarn lint:sol", - "lint:sol": "solhint contracts/**/**/**/**/**/**/**/*.sol", + "lint:sol": "solhint 'contracts/**/*.sol'", "lint:fix": "eslint --cache --fix . && solhint --fix contracts/**/*.sol", "test": "yarn compile && npx hardhat test", "debug": "DEBUG=true yarn compile && npx hardhat test" @@ -42,6 +42,7 @@ }, "lint-staged": { "*.js": "eslint --cache --fix", + "*.sol": "solhint", "*.{js,sol,css,md}": "prettier --write" } }