-
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
feat: add --skip <filter> to forge build #3370
Conversation
prj.write_config(config); | ||
|
||
// only builds the single template contract `src/*` | ||
cmd.args(["build", "--skip", "tests", "--skip", "scripts"]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit, but should we change to test
and skip
to match the default folder names? or was this intentional to not match those folder names?
cmd.args(["build", "--skip", "tests", "--skip", "scripts"]); | |
cmd.args(["build", "--skip", "test", "--skip", "script"]); | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that actually makes more sense, I guess we can just do test[s]?
and script[s]?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems reasonable to me!
Thank you! |
This is great! Thoughts on adding this to Currently, if I run (I can work around this temporarily by specifying a separate |
I'd prefer not adding
@holic Why do you want your test artifacts in a different directory than contract artifacts? |
It's not that I want to skip particular tests, but rather skip generating build files for tests. I am checking into git the contract artifacts (the results of I use these ABIs to generate types (also checked in), and including tests and scripts means there's a bunch of unnecessary type generation happening. In the type generation step, I am currently ignoring these files manually: https://github.com/holic/web3-scaffold/blob/main/packages/contracts/package.json#L14 If I instead Lemme know if all that makes sense? |
Writing all that out, I am now thinking it might be better for me to have a specific build command for generating checked-in files (e.g. ABIs) to their own directory rather and trying to conditionally ignore certain build files in |
* feat: add --skip <filter> to forge build * feat: add skip filter * integrate filter * chore: bump ethers * test: pin version Co-authored-by: Georgios Konstantopoulos <[email protected]>
Motivation
Closes #3366
add
--skip <filter>
to exclude matching contracts, with aliases for tests (--skip tests) and scripts (--skip scripts).--skip tests scripts
for excluding*.[s].sol
contractscc @tynes
Solution