-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support glob patterns in --skip
option (e.g. to skip entire tests dir)
#4628
Comments
forge build
to skip entire tests dir--skip
option (e.g. to skip entire tests dir)
@mattsse do we currently only support skip filters by file name here, and not by paths? If so this seems like a good idea, because helper files in test/script dirs usually do not contain the |
This would be extremely valuable for users running Slither on their foundry codebase. Unfortunately, running |
just to summarize: --skip should support globs?
I don't fully understand what this means exactly. should |
okay this should actually be very simple: just need to change how this filter behaves, because rn it operates on file name and expects .(s|t).sol style naming, that's why you observed that sometimes it pulls in contracts from tests scripts folder, gotcha sorry should have followed up on this issue earlier... Lines 525 to 537 in 8ecdc2a
|
What will happen if a skipped file is a dependency of a file in |
@mattsse If you could point me in the right direction, I could probably knock this out |
ah yikes, sorry I totally forgot about this again... I think what we want here is a variant that supports globs? Lines 485 to 494 in 8ecdc2a
or rather interpret the Lines 525 to 537 in 8ecdc2a
currently this just checks if the file name includes the value: Line 502 in 8ecdc2a
we could check if this is a glob |
Component
Forge
Describe the feature you would like
Currently, you can specify the
--skip
option when runningforge build
to ignore certain files specifically. There's also special handlings forscripts
andtests
which excludes.t.sol
and.s.sol
files respecitively. It would be great if we could also exclude glob patterns.My use-case specifically is to run
forge build
while ignoring the entiretests
directory when generating code based onforge build
artifacts. Specifically, I'm using the build artifacts to then runcast interface
on them to produce interface representations for different solc versions so I can write my integration tests in Solidity >0.8.10). This creates a "chicken and egg" problem where I can't generate those interfaces if my test files currently don't compile but in order for them to compile I'd need to generate the interfaces first.Additional context
We've solved this for now with a little workaround:
The text was updated successfully, but these errors were encountered: