Repository navigation
fix: get forge lint -D warnings green again - #217
Conversation
The rainix pin the sol workflows run moved on 2026-09-29; rain.flare last
pushed to main on 2026-09-14, so nothing has exercised the static job
since and `forge lint -D warnings` is red on main independently of any
open branch. Two separate causes, and the first hides the second.
solc aborts first. `forge lint` only sees the files slither's build
skipped, so in CI it compiles test/ fresh and `-D warnings` denies solc's
own diagnostics: two `Function state mutability can be restricted to
view` on the flrETH expectRevert wrappers. Locally they never appear,
because a previous `forge build` already cached those artifacts — the
only faithful local reproduction is `forge clean` first.
With those fixed solc passes and the ten forge-lint findings behind it
become reachable, each getting the scoped disable plus its reason that
the workflow's own comment asks for rather than a wholesale silence:
block-timestamp x2 comparing against block.timestamp IS the staleness
check these two libraries implement
unsafe-typecast x6 bytes32("<word name>") on ASCII literals far under
32 bytes, and the literal is what the test asserts
unsafe-typecast x2 bytes21() over a 21-byte allocation, and bytes1()
whose whole job is to keep the leading byte
No behavior changes: 85 passed / 0 failed, and `forge clean` followed by
`forge lint -D warnings` is now silent.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (3)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. WalkthroughThe change adds lint suppressions and comments around timestamp comparisons and byte conversions. It also declares two test wrapper functions ChangesSolidity lint and test declaration updates
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~3 minutes Change: Other Merge Risk: ⚪ Minimal · up to The changes adjust lint suppressions and mark two existing test wrappers as view; production checks and test assertions remain unchanged. No user-facing risk is evident; merge after routine CI checks. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
`slither .` exits 255 on this branch and the 255 is this branch's doing.
`SlitherCore.has_ignore_comment` reads exactly `min(lines) - 1` for a finding,
so `//slither-disable-next-line timestamp` only suppresses while it is the line
immediately above the flagged code. Two of the ten scoped
`//forge-lint: disable-next-line(block-timestamp)` comments the previous commit
added landed between an existing slither comment and its `if`, pushing the
slither comment to `min(lines) - 2` and silently unsuppressing both `timestamp`
findings. Two results under the default `--fail-on pedantic` is `sys.exit(-1)`.
Slither's region form carries no adjacency requirement — `has_ignore_comment`
matches on `start < lines[0] and end > lines[-1]` — so both sites take
`//slither-disable-start timestamp` / `//slither-disable-end timestamp` around
the `if` and leave the forge-lint comment where forge lint needs it. That is
the shape `src/interface/IDineroFlrEth.sol` already uses for the same
collision. No detector is excluded and `slither.config.json` is untouched.
The two `ERROR:Slither:` lines on the same CI run are an older, separate bug
that pre-dates both branches. `parse_ignore_comments` does
`end_match[0].split(",")`, so a bare `//slither-disable-end` asks for the range
of a check literally named `""`, which no `-start` ever opened: it logs
"slither-disable-end without slither-disable-start", returns, and leaves
`naming-convention` open from line 6 to infinity, after which the second pass
over the file logs "Consecutive slither-disable-starts". Hence the end comment
now names its detector. Closing the range surfaces nothing new, because
`tokensPerLST` is already valid mixedCase; only `LSTPerToken` ever needed it.
Unpiped exits in the devshell at the CI pin, after `slither .`'s own
`forge clean` so `forge lint` compiles test/ fresh the way CI does:
slither . 0 (0 result(s) found, no ERROR lines)
forge fmt --check 0
forge lint -D warnings 0
pre-commit --all-files 0
rainix-sol-single-contract 0
comment-loc-cap 0 (src 1631 against a cap of 1874)
What separates the two causes: with only the `-end` detector name fixed and the
two timestamp sites left as they were, `slither .` is still 255 with the same 2
results and no ERROR lines at all.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…k change #217 fixes `forge lint -D warnings` and `slither .` being red on `main` for reasons unrelated to the fork block. Carried here so the static job on this branch reports on the fork change rather than on #217's breakage; it drops out of this diff the moment #217 merges. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
forge lint -D warningsis red onmainright now, independently of any openbranch. The rainix pin the sol workflows run moved on 2026-09-29
(
RAINIX_SHA->8657b83); rain.flare last pushed tomainon 2026-09-14, sonothing has exercised the static job since and the breakage has been sitting
latent. Every branch opened off
mainreds on it — on the branch I hit thisfrom, the
testandlegaljobs pass and onlystaticfails.Two separate causes, and the first hides the second.
solc aborts before forge-lint is reached
forge lintonly compiles what slither's build skipped (slither runs--skip ./test/** ./script/**), so in CI it compilestest/fresh — and-Dis a compiler flag, so it denies solc's own diagnostics too:
Those are the two
expectRevertwrappers, which only read. They getview.Worth recording because it cost me a wrong diagnosis: locally these warnings
do not appear at all, because any earlier
forge buildhas already cachedthose artifacts and solc never re-runs for them.
forge cleanfirst is the onlyfaithful local reproduction of the CI step.
the ten forge-lint findings behind it
With solc passing they become reachable. Each gets the scoped
//forge-lint: disable-next-line(<id>)plus the line saying why, which is whatthe workflow's own comment asks for, rather than a wholesale silence:
block-timestampblock.timestampIS the staleness checkLibFtsoV2LTS/LibFtsoCurrentPriceUsdimplement; both already carry the matchingslither-disable-next-line timestampunsafe-typecastbytes32("<word name>")on ASCII literals far under 32 bytes — and the literal is precisely what the test assertsunsafe-typecastbytes21()over anew bytes(21)allocation, so nothing is dropped; andbytes1(feedId), whose entire job is to keep the leading category byteQA
discriminate. The existing suite is the regression check and it is unchanged at
85 passed / 0 failed. The gate itself is the test:
forge cleanthenforge lint -D warningsgoes fromError: Compiler run failedtoCompiler run successful!with no findings printed.viewkeyword and ten comment lines, so there is nobehavior to mutate. The two libraries this touches were mutation-probed
separately on the fork-block branch (8 mutants, 8 killed, 0 survived) and the
disables added here change no line that probe targeted.
inferred —
forge lint -D warningson8657b83, reproduced locally under thesame pinned shell after
forge clean.mutability warnings, and all ten forge-lint findings). Nothing is silenced
wholesale and no finding is left unexplained.
🤖 Generated with Claude Code
Summary by CodeRabbit