bug(lint): a named test or script path is skipped silently since 1.8.2
Maintainers usually reply within 1 day
Nobody has claimed this yet.
- #18025 by @ninglinLiu — closed without merging
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 70/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- rust
- Domain
- cli, documentation
Research direction
Start in crates/lint/src/sol/mod.rs around lines 130-141 where active_lints filters test/script paths. See PR #17951 for the existing note style on ignored files and mirror it when a named path is skipped. Update forge/linting.mdx and the --help text for PATH. Done means forge lint script/Deploy.s.sol prints a skip note and the book matches current behaviour.
Written by the indexing model from the issue text.
Description
Component
Forge (lint)
Describe the bug
Since v1.8.2 (#16663), forge lint runs only unsafe-cheatcode and environment-read-across-mutation on files under the configured test and script directories. That is intended, but it also applies when the user names the path, and nothing says so:
$ forge lint script/Deploy.s.sol --deny warnings # the file has an incorrect-shift
$ echo $?
0
| Command | 1.8.1 | 1.8.7 |
|---|---|---|
forge lint script --deny warnings |
3 diagnostics, exit 1 | no output, exit 0 |
forge lint script/Deploy.s.sol --deny warnings |
3 diagnostics, exit 1 | no output, exit 0 |
forge lint script/Deploy.s.sol --only-lint incorrect-shift --deny warnings |
not run | no output, exit 0 |
A CI step that linted scripts before 1.8.2 now passes without checking them.
Related:
forge lint --helpsays PATH "Overrides theignoreproject config", which reads as "a named path is linted".- The book (
forge/linting.mdx:50) still says "Gas and code-size lints skip test and script files", the behaviour before 1.8.2. Lines 182-183 listblock-number-across-rollandblock-timestamp-across-warp, which #16755 merged intoenvironment-read-across-mutation. - There is no
[lint]option to lint scripts again. The only workaround is pointingscriptelsewhere (FOUNDRY_SCRIPT=__none__ forge lint script).
Cause: active_lints (crates/lint/src/sol/mod.rs:130-141 at d291e9722).
Proposal, smallest first:
- Print a note when a named path, or every file, is skipped because it is a test or script (like the note for ignored files in #17951).
- Update the PATH help and the book.
- Optionally, a
[lint]option to lint scripts (scripts send real transactions, so some lints matter there).
I can open PRs for 1 and 2 (book).
Operating System
macOS
🤖 Generated with Claude Code
- Dominant language
- Rust
- Stars
- 10.8k
- Forks
- 2.7k
- Avg merge
- 1d 12m
- Merged PRs (30d)
- 591
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from foundry-rs/foundry
-
forge: fork preflight reads still send `requireCanonical: false`, which Rootstock rejects (-32603)Possibly taken @Ynyesto claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
foundry-rs/foundry#18485 ·
Maintainers usually reply within 1 day
-
bug(`forge fmt`): writes the file when it does not parse, deleting code after the parse errorPossibly taken @Thomas-Smets claimed this 11 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
foundry-rs/foundry#18181 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
foundry-rs/foundry#18157 ·
Maintainers usually reply within 1 day
-
bug(config): an empty FOUNDRY_* variable overrides foundry.tomlPossibly taken @rome-xi claimed this 11 days ago. OpenA-config T-bug T-to-discuss
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
foundry-rs/foundry#18153 · 1 comment ·
Maintainers usually reply within 1 day
-
bug(config): extends collision error suggests `extends_strategy`, which is not a keyPossibly taken @aelmanaa claimed this 13 days ago. OpenA-config T-bug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
foundry-rs/foundry#18110 ·
Maintainers usually reply within 1 day
All issues in foundry-rs/foundry
Similar issues
-
good first issue help wanted
Difficulty 1/5 Under an hour Newbie friendliness 87/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
jolars/panache#627 · 1 comment ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
swc-project/swc-next-issues#490 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
oxc-project/tsrs#1010 ·
Maintainers usually reply within 1 day
-
Link is deadOpen
Difficulty 1/5 Under an hour Newbie friendliness 63/100
nicholas-ochoa/OpenSC2K#104 ·