Skip to content
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

fd --exec should fail if one of --exec fails #526 #531

Merged
merged 8 commits into from
Feb 22, 2020

Conversation

fusillicode
Copy link
Contributor

@fusillicode fusillicode commented Jan 25, 2020

Me and @Giuffre tried to tackle this issue during our monthly OSS meeting 😄:

Open Source Saturday

We apologize in advance if we didn't properly addressed what stated in the over mentioned issue and we remain at disposal to further work on it during our next meeting 🙇

P.S: thank you a lot for this wonderful crate! 🙇‍♂️

@fusillicode fusillicode changed the title Issue 526 fd --exec should fail if one of --exec fails #526 Jan 25, 2020
Copy link
Owner

@sharkdp sharkdp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great. Thank you very much. Is there any way we could write an integration test for this?

src/exec/job.rs Outdated Show resolved Hide resolved

impl ExitCode {
pub fn error_if_any_error(results: Vec<Self>) -> Self {
if results.iter().any(|s| match s {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this match should be extracted into another function: ExitCode::is_error?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This way, we could simply run: if results.iter().any(ExitCode::is_error) { … }

}
}
}

impl ExitCode {
pub fn error_if_any_error(results: Vec<Self>) -> Self {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It feels a little strange to me to have this in an impl ExitCode block. I think it could easily be a free function.

As for the naming, maybe: merge_exitcodes?

Finally: can we please add a few unit tests for this function (in this file)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I've added a few interesting unit tests of merge_exitcodes.

Let us know if they're good enough 😄

@sharkdp
Copy link
Owner

sharkdp commented Jan 26, 2020

P.S: thank you a lot for this wonderful crate! bowing_man️

Thank you!

@fusillicode
Copy link
Contributor Author

Hi 😄

I've checked all your comments and suggestions and I'll follow them as soon as possible.

I hope to be able to polish this PR before the next monthly meeting of the Open Source Saturday but unfortunately I can't promise that (I wish I could 😞)

@sharkdp
Copy link
Owner

sharkdp commented Jan 26, 2020

I hope to be able to polish this PR before the next monthly meeting of the Open Source Saturday but unfortunately I can't promise that (I wish I could)

Hey, no worries. There's absolutely no time pressure here. We'll merge it whenever it's ready. Thank you!

@fusillicode
Copy link
Contributor Author

♾ 🙇

@fusillicode
Copy link
Contributor Author

I think I've addressed pretty much everything that was pointed out last month 🤔

I remain obviously at your total disposal for every new comments 😄

@sharkdp sharkdp self-assigned this Feb 22, 2020
Copy link
Owner

@sharkdp sharkdp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much for the updates! Looks great.

@sharkdp sharkdp merged commit 0f2429c into sharkdp:master Feb 22, 2020
@fusillicode
Copy link
Contributor Author

@sharkdp thank you once again for all your invaluable work & support! 🙇‍♂️

We really hope to be able to further contribute to your projects! 😄

Cheers!

@sharkdp
Copy link
Owner

sharkdp commented Feb 22, 2020

Looking forward to it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants