From 5e6d1779cb51fc1687c46f687a2140e05b0a6559 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Mon, 10 Dec 2018 15:20:52 -0800 Subject: Re-use solhint configuration --- contracts/.solhint.json | 20 ++++++++++++++++++++ contracts/examples/.solhint.json | 20 -------------------- contracts/examples/package.json | 4 ++-- contracts/extensions/.solhint.json | 20 -------------------- contracts/extensions/package.json | 4 ++-- contracts/interfaces/.solhint.json | 20 -------------------- contracts/interfaces/package.json | 4 ++-- contracts/libs/.solhint.json | 20 -------------------- contracts/libs/package.json | 4 ++-- contracts/multisig/.solhint.json | 20 -------------------- contracts/multisig/package.json | 4 ++-- contracts/protocol/.solhint.json | 20 -------------------- contracts/protocol/package.json | 4 ++-- contracts/tokens/.solhint.json | 20 -------------------- contracts/tokens/package.json | 4 ++-- contracts/utils/.solhint.json | 20 -------------------- contracts/utils/package.json | 4 ++-- 17 files changed, 36 insertions(+), 176 deletions(-) create mode 100644 contracts/.solhint.json delete mode 100644 contracts/examples/.solhint.json delete mode 100644 contracts/extensions/.solhint.json delete mode 100644 contracts/interfaces/.solhint.json delete mode 100644 contracts/libs/.solhint.json delete mode 100644 contracts/multisig/.solhint.json delete mode 100644 contracts/protocol/.solhint.json delete mode 100644 contracts/tokens/.solhint.json delete mode 100644 contracts/utils/.solhint.json diff --git a/contracts/.solhint.json b/contracts/.solhint.json new file mode 100644 index 000000000..076afe9f3 --- /dev/null +++ b/contracts/.solhint.json @@ -0,0 +1,20 @@ +{ + "extends": "default", + "rules": { + "avoid-low-level-calls": false, + "avoid-tx-origin": "warn", + "bracket-align": false, + "code-complexity": false, + "const-name-snakecase": "error", + "expression-indent": "error", + "function-max-lines": false, + "func-order": "error", + "indent": ["error", 4], + "max-line-length": ["warn", 160], + "no-inline-assembly": false, + "quotes": ["error", "double"], + "separate-by-one-line-in-contract": "error", + "space-after-comma": "error", + "statement-indent": "error" + } +} diff --git a/contracts/examples/.solhint.json b/contracts/examples/.solhint.json deleted file mode 100644 index 076afe9f3..000000000 --- a/contracts/examples/.solhint.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "extends": "default", - "rules": { - "avoid-low-level-calls": false, - "avoid-tx-origin": "warn", - "bracket-align": false, - "code-complexity": false, - "const-name-snakecase": "error", - "expression-indent": "error", - "function-max-lines": false, - "func-order": "error", - "indent": ["error", 4], - "max-line-length": ["warn", 160], - "no-inline-assembly": false, - "quotes": ["error", "double"], - "separate-by-one-line-in-contract": "error", - "space-after-comma": "error", - "statement-indent": "error" - } -} diff --git a/contracts/examples/package.json b/contracts/examples/package.json index c18f1ae79..083b47457 100644 --- a/contracts/examples/package.json +++ b/contracts/examples/package.json @@ -18,7 +18,7 @@ "clean": "shx rm -rf lib generated-artifacts generated-wrappers", "generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --template ../../node_modules/@0x/abi-gen-templates/contract.handlebars --partials '../../node_modules/@0x/abi-gen-templates/partials/**/*.handlebars' --output generated-wrappers --backend ethers", "lint": "tslint --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts", - "lint-contracts": "solhint contracts/**/**/**/**/*.sol" + "lint-contracts": "solhint -c ../.solhint.json contracts/**/**/**/**/*.sol" }, "config": { "abis": "generated-artifacts/@(ExchangeWrapper|Validator|Wallet|Whitelist).json" @@ -54,7 +54,7 @@ "npm-run-all": "^4.1.2", "shx": "^0.2.2", "solc": "^0.4.24", - "solhint": "^1.2.1", + "solhint": "^1.4.1", "tslint": "5.11.0", "typescript": "3.0.1", "yargs": "^10.0.3" diff --git a/contracts/extensions/.solhint.json b/contracts/extensions/.solhint.json deleted file mode 100644 index 076afe9f3..000000000 --- a/contracts/extensions/.solhint.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "extends": "default", - "rules": { - "avoid-low-level-calls": false, - "avoid-tx-origin": "warn", - "bracket-align": false, - "code-complexity": false, - "const-name-snakecase": "error", - "expression-indent": "error", - "function-max-lines": false, - "func-order": "error", - "indent": ["error", 4], - "max-line-length": ["warn", 160], - "no-inline-assembly": false, - "quotes": ["error", "double"], - "separate-by-one-line-in-contract": "error", - "space-after-comma": "error", - "statement-indent": "error" - } -} diff --git a/contracts/extensions/package.json b/contracts/extensions/package.json index 07163f78a..9d60317a0 100644 --- a/contracts/extensions/package.json +++ b/contracts/extensions/package.json @@ -30,7 +30,7 @@ "profiler:report:html": "istanbul report html && open coverage/index.html", "coverage:report:lcov": "istanbul report lcov", "test:circleci": "yarn test", - "lint-contracts": "solhint contracts/**/**/**/**/*.sol" + "lint-contracts": "solhint -c ../.solhint.json contracts/**/**/**/**/*.sol" }, "config": { "abis": "generated-artifacts/@(DutchAuction|Forwarder|OrderValidator).json" @@ -66,7 +66,7 @@ "npm-run-all": "^4.1.2", "shx": "^0.2.2", "solc": "^0.4.24", - "solhint": "^1.2.1", + "solhint": "^1.4.1", "tslint": "5.11.0", "typescript": "3.0.1", "yargs": "^10.0.3" diff --git a/contracts/interfaces/.solhint.json b/contracts/interfaces/.solhint.json deleted file mode 100644 index 076afe9f3..000000000 --- a/contracts/interfaces/.solhint.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "extends": "default", - "rules": { - "avoid-low-level-calls": false, - "avoid-tx-origin": "warn", - "bracket-align": false, - "code-complexity": false, - "const-name-snakecase": "error", - "expression-indent": "error", - "function-max-lines": false, - "func-order": "error", - "indent": ["error", 4], - "max-line-length": ["warn", 160], - "no-inline-assembly": false, - "quotes": ["error", "double"], - "separate-by-one-line-in-contract": "error", - "space-after-comma": "error", - "statement-indent": "error" - } -} diff --git a/contracts/interfaces/package.json b/contracts/interfaces/package.json index 6461e9779..9ba41192c 100644 --- a/contracts/interfaces/package.json +++ b/contracts/interfaces/package.json @@ -15,7 +15,7 @@ "clean": "shx rm -rf lib generated-artifacts generated-wrappers", "generate_contract_wrappers": "abi-gen --abis ${npm_package_config_abis} --template ../../node_modules/@0x/abi-gen-templates/contract.handlebars --partials '../../node_modules/@0x/abi-gen-templates/partials/**/*.handlebars' --output generated-wrappers --backend ethers", "lint": "tslint --format stylish --project . --exclude ./generated-wrappers/**/* --exclude ./generated-artifacts/**/* --exclude **/lib/**/* && yarn lint-contracts", - "lint-contracts": "solhint contracts/**/**/**/**/*.sol" + "lint-contracts": "solhint -c ../.solhint.json contracts/**/**/**/**/*.sol" }, "config": { "abis": "generated-artifacts/@(IAssetData|IAssetProxy|IAuthorizable|IAssetProxyDispatcher|IExchange|IExchangeCore|IMatchOrders|ISignatureValidator|ITransactions|IValidator|IWallet|IWrapperFunctions).json" @@ -35,7 +35,7 @@ "@0x/tslint-config": "^1.0.10", "npm-run-all": "^4.1.2", "shx": "^0.2.2", - "solhint": "^1.2.1", + "solhint": "^1.4.1", "tslint": "5.11.0", "typescript": "3.0.1", "yargs": "^10.0.3" diff --git a/contracts/libs/.solhint.json b/contracts/libs/.solhint.json deleted file mode 100644 index 076afe9f3..000000000 --- a/contracts/libs/.solhint.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "extends": "default", - "rules": { - "avoid-low-level-calls": false, - "avoid-tx-origin": "warn", - "bracket-align": false, - "code-complexity": false, - "const-name-snakecase": "error", - "expression-indent": "error", - "function-max-lines": false, - "func-order": "error", - "indent": ["error", 4], - "max-line-length": ["warn", 160], - "no-inline-assembly": false, - "quotes": ["error", "double"], - "separate-by-one-line-in-contract": "error", - "space-after-comma": "error", - "statement-indent": "error" - } -} diff --git a/contracts/libs/package.json b/contracts/libs/package.json index c25730fd2..a01b51b42 100644 --- a/contracts/libs/package.json +++ b/contracts/libs/package.json @@ -30,7 +30,7 @@ "profiler:report:html": "istanbul report html && open coverage/index.html", "coverage:report:lcov": "istanbul report lcov", "test:circleci": "yarn test", - "lint-contracts": "solhint contracts/**/**/**/**/*.sol" + "lint-contracts": "solhint -c ../.solhint.json contracts/**/**/**/**/*.sol" }, "config": { "abis": "generated-artifacts/@(LibMath|LibOrder|LibFillResults|LibAbiEncoder|TestLibs|LibEIP712).json" @@ -66,7 +66,7 @@ "npm-run-all": "^4.1.2", "shx": "^0.2.2", "solc": "^0.4.24", - "solhint": "^1.2.1", + "solhint": "^1.4.1", "tslint": "5.11.0", "typescript": "3.0.1", "yargs": "^10.0.3" diff --git a/contracts/multisig/.solhint.json b/contracts/multisig/.solhint.json deleted file mode 100644 index 076afe9f3..000000000 --- a/contracts/multisig/.solhint.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "extends": "default", - "rules": { - "avoid-low-level-calls": false, - "avoid-tx-origin": "warn", - "bracket-align": false, - "code-complexity": false, - "const-name-snakecase": "error", - "expression-indent": "error", - "function-max-lines": false, - "func-order": "error", - "indent": ["error", 4], - "max-line-length": ["warn", 160], - "no-inline-assembly": false, - "quotes": ["error", "double"], - "separate-by-one-line-in-contract": "error", - "space-after-comma": "error", - "statement-indent": "error" - } -} diff --git a/contracts/multisig/package.json b/contracts/multisig/package.json index e659d39ba..2114099f1 100644 --- a/contracts/multisig/package.json +++ b/contracts/multisig/package.json @@ -29,7 +29,7 @@ "profiler:report:html": "istanbul report html && open coverage/index.html", "coverage:report:lcov": "istanbul report lcov", "test:circleci": "yarn test", - "lint-contracts": "solhint contracts/**/**/**/**/*.sol" + "lint-contracts": "solhint -c ../.solhint.json contracts/**/**/**/**/*.sol" }, "config": { "abis": "generated-artifacts/@(MultiSigWallet|MultiSigWalletWithTimeLock|TestRejectEther).json" @@ -65,7 +65,7 @@ "npm-run-all": "^4.1.2", "shx": "^0.2.2", "solc": "^0.4.24", - "solhint": "^1.2.1", + "solhint": "^1.4.1", "tslint": "5.11.0", "typescript": "3.0.1", "yargs": "^10.0.3" diff --git a/contracts/protocol/.solhint.json b/contracts/protocol/.solhint.json deleted file mode 100644 index 076afe9f3..000000000 --- a/contracts/protocol/.solhint.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "extends": "default", - "rules": { - "avoid-low-level-calls": false, - "avoid-tx-origin": "warn", - "bracket-align": false, - "code-complexity": false, - "const-name-snakecase": "error", - "expression-indent": "error", - "function-max-lines": false, - "func-order": "error", - "indent": ["error", 4], - "max-line-length": ["warn", 160], - "no-inline-assembly": false, - "quotes": ["error", "double"], - "separate-by-one-line-in-contract": "error", - "space-after-comma": "error", - "statement-indent": "error" - } -} diff --git a/contracts/protocol/package.json b/contracts/protocol/package.json index 6ed2f34e9..ed1953f21 100644 --- a/contracts/protocol/package.json +++ b/contracts/protocol/package.json @@ -30,7 +30,7 @@ "profiler:report:html": "istanbul report html && open coverage/index.html", "coverage:report:lcov": "istanbul report lcov", "test:circleci": "yarn test", - "lint-contracts": "solhint contracts/**/**/**/**/*.sol" + "lint-contracts": "solhint -c ../.solhint.json contracts/**/**/**/**/*.sol" }, "config": { "abis": "generated-artifacts/@(AssetProxyOwner|ERC20Proxy|ERC721Proxy|Exchange|MixinAuthorizable|MultiAssetProxy|TestSignatureValidator|TestAssetProxyOwner|TestAssetProxyDispatcher|TestExchangeInternals|TestStaticCallReceiver).json" @@ -66,7 +66,7 @@ "npm-run-all": "^4.1.2", "shx": "^0.2.2", "solc": "^0.4.24", - "solhint": "^1.2.1", + "solhint": "^1.4.1", "tslint": "5.11.0", "typescript": "3.0.1", "yargs": "^10.0.3" diff --git a/contracts/tokens/.solhint.json b/contracts/tokens/.solhint.json deleted file mode 100644 index 076afe9f3..000000000 --- a/contracts/tokens/.solhint.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "extends": "default", - "rules": { - "avoid-low-level-calls": false, - "avoid-tx-origin": "warn", - "bracket-align": false, - "code-complexity": false, - "const-name-snakecase": "error", - "expression-indent": "error", - "function-max-lines": false, - "func-order": "error", - "indent": ["error", 4], - "max-line-length": ["warn", 160], - "no-inline-assembly": false, - "quotes": ["error", "double"], - "separate-by-one-line-in-contract": "error", - "space-after-comma": "error", - "statement-indent": "error" - } -} diff --git a/contracts/tokens/package.json b/contracts/tokens/package.json index 07ff622f8..b741527b7 100644 --- a/contracts/tokens/package.json +++ b/contracts/tokens/package.json @@ -30,7 +30,7 @@ "profiler:report:html": "istanbul report html && open coverage/index.html", "coverage:report:lcov": "istanbul report lcov", "test:circleci": "yarn test", - "lint-contracts": "solhint contracts/**/**/**/**/*.sol" + "lint-contracts": "solhint -c ../.solhint.json contracts/**/**/**/**/*.sol" }, "config": { "abis": "generated-artifacts/@(DummyERC20Token|DummyMultipleReturnERC20Token|DummyNoReturnERC20Token|DummyERC721Receiver|InvalidERC721Receiver|DummyERC721Token|ReentrantERC20Token|ERC20Token|IERC20Token|MintableERC20Token|UnlimitedAllowanceERC20Token|ERC721Token|IERC721Receiver|IERC721Token|MintableERC721Token|IEtherToken|WETH9|ERC20Token_v1|Token_v1|UnlimitedAllowanceToken_v1|ZRXToken).json" @@ -66,7 +66,7 @@ "npm-run-all": "^4.1.2", "shx": "^0.2.2", "solc": "^0.4.24", - "solhint": "^1.2.1", + "solhint": "^1.4.1", "tslint": "5.11.0", "typescript": "3.0.1", "yargs": "^10.0.3" diff --git a/contracts/utils/.solhint.json b/contracts/utils/.solhint.json deleted file mode 100644 index 076afe9f3..000000000 --- a/contracts/utils/.solhint.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "extends": "default", - "rules": { - "avoid-low-level-calls": false, - "avoid-tx-origin": "warn", - "bracket-align": false, - "code-complexity": false, - "const-name-snakecase": "error", - "expression-indent": "error", - "function-max-lines": false, - "func-order": "error", - "indent": ["error", 4], - "max-line-length": ["warn", 160], - "no-inline-assembly": false, - "quotes": ["error", "double"], - "separate-by-one-line-in-contract": "error", - "space-after-comma": "error", - "statement-indent": "error" - } -} diff --git a/contracts/utils/package.json b/contracts/utils/package.json index 6163b1ae7..27b29eaad 100644 --- a/contracts/utils/package.json +++ b/contracts/utils/package.json @@ -30,7 +30,7 @@ "profiler:report:html": "istanbul report html && open coverage/index.html", "coverage:report:lcov": "istanbul report lcov", "test:circleci": "yarn test", - "lint-contracts": "solhint contracts/**/**/**/**/*.sol" + "lint-contracts": "solhint -c ../.solhint.json contracts/**/**/**/**/*.sol" }, "config": { "abis": "generated-artifacts/@(IOwnable|Ownable|LibBytes|ReentrancyGuard|SafeMath|TestConstants|TestLibBytes).json" @@ -67,7 +67,7 @@ "npm-run-all": "^4.1.2", "shx": "^0.2.2", "solc": "^0.4.24", - "solhint": "^1.2.1", + "solhint": "^1.4.1", "tslint": "5.11.0", "typescript": "3.0.1", "yargs": "^10.0.3" -- cgit v1.2.3