-
Notifications
You must be signed in to change notification settings - Fork 6
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
[Tracking Issue] Whole project review #36
Comments
I would address this in the following order:
|
Since
Aaah, perfect! Thanks, I'll open an issue for this.
I do not know if the config dump has a specific format. @philberty?
You're right. Thanks!
When first launching
I think it would be fine to have two binaries. Basically, what the current one is doing is the following:
Note the difference in the call with the extra dash. One invokes the cargo subcommand, while the other one invokes the actual binary. (Oh, @bjorn3 had already answered: #21 (comment) Sorry!) In order to differentiate, we can simply check the first argument. I agree that having multiple binaries make sense, and I think it's a better way to go about it and it's clearer.
For a single Note that this might change thanks to @bjorn3 's really nice and detailed proposition here that we must discuss.
Good point. I'll get to the refactoring of I agree that the impl is getting way too big and hard to follow. I haven't worked on it since adding the callback, and it's in desperate need of a refactoring. |
|
Woops :( Well then I'll remove it. It made sense in theory haha |
Finished in #21 Great work! |
This is a review of the binary library split branch:
cleanup-error-handling
First posted in #21 (review), but I wanted to also track this outside of the PR.
I figured that this is now the right time to do a whole project review, and not only a review of #21. My suggestions don't have to be implemented all in one PR, but rather get implemented step by step. I tried to sort them from easy to hard to do.
cfg!(release)
What is this line supposed to do?
cargo-gccrs/src/gccrs.rs
Line 23 in e47fe3b
is_installed
cargo-gccrs/src/gccrs.rs
Lines 43 to 44 in e47fe3b
You can use the
which
crate for cross-platform support for thisserde
for config dump/parsing?cargo-gccrs/src/config.rs
Lines 1 to 4 in e47fe3b
What format is the config dump in and can you use serde for this?
cargo-gccrs/src/config.rs
Lines 101 to 102 in e47fe3b
A fallible display impl seems weird to me. You should rather implement a fallible constructor and then the
Display
trait. That way you can use the format machinery and get functions liketo_string
for free.I'm also not 100% sure what the option dumping is for, so please tell me if there is a reason why it has to be done that way.
I think you want to have 2 binaries here. One for the driver, that does all the argument conversion and other hard work, and one that just invokes the driver from the cargo command. But I may be misunderstanding something, see my comment #21 (comment)
GccrsArgs
not holding all argumentscargo-gccrs/src/args.rs
Line 171 in e47fe3b
I still don't quite get why it is necessary to return a
Vec<GccrsArgs>
. Just from the struct name and the documentation, I would assume that when I have aGccrsArgs
instance, that I have all the arguments that I need. This is also the main thing that prevents theGccrsArgs
from implementing things like theTryFrom
trait and so on.GccrsArgs
is doing too muchcargo-gccrs/src/args.rs
Lines 164 to 168 in e47fe3b
I still think that with this,
GccrsArgs
is doing too much. One good principle of OOP is that one class should only do one thing. With that principle,GccrsArgs
should only handle arguments, which includes parsing, converting, and then holding them. Now it handles arguments and does random other things like creating archives and in the future possibly even more.This is the area of the current implementation that really needs a refactor IMHO. Apply the KISS principle as often as you can. I have trouble following what is done where, so the current impl isn't really simple to follow.
The text was updated successfully, but these errors were encountered: