-
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
Issue #8664 | Bug 🐛: --match-path does not work with watch mode: cannot be used multiple times #8664 #8709
Conversation
…mode: cannot be used multiple times foundry-rs#8664
crates/forge/bin/cmd/watch.rs
Outdated
|
||
// Check if any of the filters are present | ||
let path_pattern_exists = filter.args().path_pattern.is_some(); | ||
|
||
// Marker to check whether to override the command. | ||
let _no_reconfigure = filter.args().test_pattern.is_some() || |
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.
I think we should just use no_reconfigure
here, looks like this was used earlier to avoid updating the command if any filters were set
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.
Done ✅, thank you for the review 👍🏾
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.
please remove newlines and I think there's no need for underscore in var name name
crates/forge/bin/cmd/watch.rs
Outdated
|
||
// Check if any of the filters are present | ||
let path_pattern_exists = filter.args().path_pattern.is_some(); | ||
|
||
// Marker to check whether to override the command. | ||
let _no_reconfigure = filter.args().test_pattern.is_some() || |
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.
please remove newlines and I think there's no need for underscore in var name name
…mode: cannot be used multiple times foundry-rs#8664 (foundry-rs#8709) * Issue foundry-rs#8664 | Bug 🐛: --match-path does not work with watch mode: cannot be used multiple times foundry-rs#8664 * reuse _no_reconfigure var * Remove undescore var name and also remove no needed extra lines * fmt --------- Co-authored-by: Arsenii Kulikov <[email protected]>
Issue Link -> #8664
Pull Request Description
Currently the following command was being attempted to be executed:
forge test --match-path test/Counter.t.sol -w
But by default it can be done without the --math-path, since the command adds it by itself
--match-path does not work with watch mode: cannot be used multiple times
`error: the argument '--match-path ' cannot be used multiple times
Usage: forge test [OPTIONS]
For more information, try '--help'.
[Command exited with 2, lasted 10.7375ms]`
Motivation
My motivation is to continue contributing to tools like Foundry, to learn from them and how they work in Open Source environments. I really like to always be in constant practice and what better way to do it than by practicing and helping the community.
Solution
Currently when running the command:
forge test --match-path test/Counter.t.sol --watch
It is not necessary to add the ---match-path because by default the --watch is added by code, now what I did was add a validation that if it already has it in the arguments, do not add it to avoid redundancy and errors like the reported issue