Skip to content

Commit c5b3b8d

Browse files
chore: update foundry.toml to include forge lint config (#1539)
**Motivation:** Foundry will be adding `forge lint` to stable soon, I want to support `forge lint` config beforehand. **Modifications:** - Added `forge lint` related config to `Foundry.toml`. - Disabled linting for `script` and `src/test`. **Result:** Can configure `forge lint`.
2 parents a1df1a6 + dd178a6 commit c5b3b8d

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

foundry.toml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,46 @@
116116
"./src/contracts/**/*"
117117
]
118118

119+
[profile.default.lint]
120+
# Whether to run the linter when building.
121+
lint_on_build = false
122+
# Specifies which lints to run based on severity.
123+
severity = [
124+
"high",
125+
"med",
126+
"low",
127+
"info",
128+
"gas"
129+
]
130+
# List of lints to exclude from linting.
131+
exclude_lints = [
132+
# High
133+
# "incorrect-shift",
134+
# "unchecked-call",
135+
# "erc20-unchecked-transfer",
136+
137+
# Medium
138+
# "divide-before-multiply",
139+
140+
# Info
141+
# "unused-import",
142+
# "unaliased-plain-import",
143+
# "mixed-case-function",
144+
# "mixed-case-variable",
145+
# "pascal-case-struct",
146+
# "screaming-snake-case-const",
147+
# "screaming-snake-case-immutable",
148+
149+
# Gas
150+
# "asm-keccak256",
151+
# "unwrapped-modifier-logic"
152+
]
153+
# List of files or patterns to ignore when running the linter (can use glob patterns)
154+
ignore = [
155+
"src/test/**/*",
156+
"script/**/*"
157+
]
158+
119159
[profile.forktest.fuzz]
120160
optimizer = false
121161
runs = 16

0 commit comments

Comments
 (0)