Commit 2ef045ce authored by Mark Tyneway's avatar Mark Tyneway

contracts-bedrock: forge fmt setup

parent b32317eb
...@@ -5,6 +5,5 @@ lib ...@@ -5,6 +5,5 @@ lib
artifacts artifacts
forge-artifacts forge-artifacts
cache cache
typechain
coverage* coverage*
deployments deployments
# Deps and test files
lib
# build output
artifacts
forge-artifacts
cache
typechain
coverage*
deployments
# Other autogenerated files
gasReporterOutput.json
slither.db.json
# MIPS.sol has special VM formatting, not like other contracts.
# Prettier also fails to handle YUL functions with multiple return variables.
contracts/cannon/MIPS.sol
module.exports = {
...require('../../.prettierrc.js'),
}
{
"extends": "solhint:recommended",
"plugins": ["prettier"],
"rules": {
"prettier/prettier": "error",
"compiler-version": "off",
"code-complexity": ["warn", 5],
"max-line-length": ["error", 100],
"func-param-name-mixedcase": "error",
"func-name-mixedcase": "off",
"modifier-name-mixedcase": "error",
"ordering": "warn",
"avoid-low-level-calls": "off",
"no-inline-assembly": "off",
"no-empty-blocks": "off",
"not-rely-on-time": "off",
"event-name-camelcase": "off",
"reason-string": "off",
"avoid-tx-origin": "off",
"var-name-mixedcase": "off",
"func-visibility": ["warn", { "ignoreConstructors": true }]
}
}
# Deps and test files
node_modules
lib
contracts/test/*.t.sol
contracts/vendor/*.sol
# MIPS.sol has special VM formatting, not like other contracts.
contracts/cannon/MIPS.sol
...@@ -29,5 +29,11 @@ fs_permissions = [ ...@@ -29,5 +29,11 @@ fs_permissions = [
{ 'access'='write', 'path'='./semver-lock.json' }, { 'access'='write', 'path'='./semver-lock.json' },
] ]
[fmt]
line_length=120
multiline_func_header="all"
bracket_spacing=true
wrap_comments=true
[profile.ci] [profile.ci]
fuzz_runs = 512 fuzz_runs = 512
...@@ -31,18 +31,16 @@ ...@@ -31,18 +31,16 @@
"preinstall": "npx only-allow pnpm", "preinstall": "npx only-allow pnpm",
"lint:ts:check": "eslint . --max-warnings=0", "lint:ts:check": "eslint . --max-warnings=0",
"lint:forge-tests:check": "ts-node scripts/forge-test-names.ts", "lint:forge-tests:check": "ts-node scripts/forge-test-names.ts",
"lint:contracts:check": "pnpm solhint -f table 'src/**/!(WETH9|DisputeTypes|MIPS|RLPReader|EAS|SchemaRegistry|IEAS|ISchemaRegistry|SchemaResolver|EIP712Verifier|ISchemaResolver).sol' && pnpm prettier --check 'src/**/!(WETH9|DisputeTypes|MIPS|RLPReader|EAS|SchemaRegistry|IEAS|ISchemaRegistry|SchemaResolver|EIP712Verifier|ISchemaResolver).sol' && pnpm lint:forge-tests:check", "lint:contracts:check": "pnpm lint:fix && git diff --exit-code",
"lint:check": "pnpm lint:contracts:check && pnpm lint:ts:check", "lint:check": "pnpm lint:contracts:check && pnpm lint:ts:check",
"lint:ts:fix": "eslint --fix .", "lint:ts:fix": "eslint --fix .",
"lint:contracts:fix": "pnpm solhint --fix 'src/**/!(WETH9|DisputeTypes|MIPS|RLPReader|EAS|SchemaRegistry|IEAS|ISchemaRegistry|SchemaResolver|EIP712Verifier|ISchemaResolver).sol' && pnpm prettier --write 'src/**/!(WETH9|DisputeTypes|MIPS|RLPReader|EAS|SchemaRegistry|IEAS|ISchemaRegistry|SchemaResolver|EIP712Verifier|ISchemaResolver).sol'", "lint:contracts:fix": "forge fmt",
"lint:fix": "pnpm lint:contracts:fix && pnpm lint:ts:fix", "lint:fix": "pnpm lint:contracts:fix && pnpm lint:ts:fix",
"lint": "pnpm lint:fix && pnpm lint:check" "lint": "pnpm lint:fix && pnpm lint:check"
}, },
"devDependencies": { "devDependencies": {
"@typescript-eslint/eslint-plugin": "^5.60.1", "@typescript-eslint/eslint-plugin": "^5.60.1",
"@typescript-eslint/parser": "^5.60.1", "@typescript-eslint/parser": "^5.60.1",
"solhint": "^3.4.1",
"solhint-plugin-prettier": "^0.0.5",
"ts-node": "^10.9.1", "ts-node": "^10.9.1",
"typescript": "^5.1.6" "typescript": "^5.1.6"
} }
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment