Skip to content

Commit 05c2743

Browse files
committed
1 parent d8f28a9 commit 05c2743

File tree

10 files changed

+135
-45
lines changed

10 files changed

+135
-45
lines changed

Cargo.lock

Lines changed: 83 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "git-mob-tool"
33
version = "1.9.2"
44
authors = ["Mubashwer Salman Khurshid"]
5-
edition = "2021"
5+
edition = "2024"
66
description = "A CLI tool which can help users automatically add co-author(s) to git commits for pair/mob programming"
77
readme = "README.md"
88
repository = "https://github.com/Mubashwer/git-mob"

src/cli.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
use crate::Result;
12
use crate::commands::{Mob, Setup, TeamMember};
23
use crate::repositories::{MobSessionRepo, TeamMemberRepo};
3-
use crate::Result;
44
use clap::{Parser, Subcommand};
55
use std::io::Write;
66
use std::str;

src/commands/mob.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
use crate::repositories::{MobSessionRepo, TeamMemberRepo};
21
use crate::Result;
3-
use clap::{arg, Parser};
2+
use crate::repositories::{MobSessionRepo, TeamMemberRepo};
3+
use clap::{Parser, arg};
44
use inquire::MultiSelect;
55
use std::io::Write;
66

@@ -361,8 +361,11 @@ mod tests {
361361
let mut out = Vec::new();
362362
let result = mob_cmd.handle(&mock_team_member_repo, &mock_mob_repo, &mut out);
363363

364-
assert!(result
365-
.is_err_and(|err| err.to_string() == format!("No team member found with key: {key}")));
364+
assert!(
365+
result.is_err_and(
366+
|err| err.to_string() == format!("No team member found with key: {key}")
367+
)
368+
);
366369

367370
Ok(())
368371
}

src/commands/team_member.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
use crate::repositories::TeamMemberRepo;
21
use crate::Result;
3-
use clap::{arg, Parser};
2+
use crate::repositories::TeamMemberRepo;
3+
use clap::{Parser, arg};
44
use std::io::Write;
55

66
#[derive(Parser)]
@@ -105,8 +105,11 @@ mod tests {
105105
let mut out = Vec::new();
106106
let result = team_member_cmd.handle(&mock_team_member_repo, &mut out);
107107

108-
assert!(result
109-
.is_err_and(|err| err.to_string() == format!("No team member found with key: {key}")));
108+
assert!(
109+
result.is_err_and(
110+
|err| err.to_string() == format!("No team member found with key: {key}")
111+
)
112+
);
110113

111114
Ok(())
112115
}

src/helpers.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,11 @@ mod tests {
5050

5151
assert!(result.status_code.is_some_and(|x| x != 0));
5252
assert!(result.stdout.is_empty());
53-
assert!(result
54-
.stderr
55-
.starts_with(b"unknown option: --invalid_option"));
53+
assert!(
54+
result
55+
.stderr
56+
.starts_with(b"unknown option: --invalid_option")
57+
);
5658

5759
Ok(())
5860
}

src/main.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
use git_mob_tool::{
2-
cli,
2+
Result, cli,
33
helpers::StdCommandRunner,
44
repositories::{GitConfigMobRepo, GitConfigTeamMemberRepo},
5-
Result,
65
};
76
use std::io::stdout;
87

src/repositories/mob_session_repo.rs

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use crate::helpers::{CmdOutput, CommandRunner};
21
use crate::Result;
2+
use crate::helpers::{CmdOutput, CommandRunner};
33

44
#[cfg(test)]
55
use mockall::{automock, predicate::*};
@@ -158,8 +158,10 @@ mod tests {
158158

159159
let result = mob_repo.list_coauthors();
160160

161-
assert!(result
162-
.is_err_and(|x| x.to_string() == "Git config command exited with status code: 129"));
161+
assert!(
162+
result
163+
.is_err_and(|x| x.to_string() == "Git config command exited with status code: 129")
164+
);
163165

164166
Ok(())
165167
}
@@ -219,8 +221,10 @@ mod tests {
219221

220222
let result = mob_repo.add_coauthor(coauthor);
221223

222-
assert!(result
223-
.is_err_and(|x| x.to_string() == "Git config command exited with status code: 129"));
224+
assert!(
225+
result
226+
.is_err_and(|x| x.to_string() == "Git config command exited with status code: 129")
227+
);
224228

225229
Ok(())
226230
}
@@ -329,8 +333,10 @@ mod tests {
329333

330334
let result = mob_repo.clear();
331335

332-
assert!(result
333-
.is_err_and(|x| x.to_string() == "Git config command exited with status code: 129"));
336+
assert!(
337+
result
338+
.is_err_and(|x| x.to_string() == "Git config command exited with status code: 129")
339+
);
334340

335341
Ok(())
336342
}

src/repositories/team_member_repo.rs

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
use crate::helpers::{CmdOutput, CommandRunner};
21
use crate::Result;
2+
use crate::helpers::{CmdOutput, CommandRunner};
33

44
#[cfg(test)]
55
use mockall::{automock, predicate::*};
@@ -207,8 +207,10 @@ mod tests {
207207

208208
let result = team_member_repo.list(true);
209209

210-
assert!(result
211-
.is_err_and(|x| x.to_string() == "Git config command exited with status code: 129"));
210+
assert!(
211+
result
212+
.is_err_and(|x| x.to_string() == "Git config command exited with status code: 129")
213+
);
212214

213215
Ok(())
214216
}
@@ -275,8 +277,10 @@ mod tests {
275277

276278
let result = team_member_repo.get(key);
277279

278-
assert!(result
279-
.is_err_and(|x| x.to_string() == "Git config command exited with status code: 129"));
280+
assert!(
281+
result
282+
.is_err_and(|x| x.to_string() == "Git config command exited with status code: 129")
283+
);
280284

281285
Ok(())
282286
}
@@ -426,8 +430,10 @@ mod tests {
426430

427431
let result = team_member_repo.add(key, team_member);
428432

429-
assert!(result
430-
.is_err_and(|x| x.to_string() == "Git config command exited with status code: 129"));
433+
assert!(
434+
result
435+
.is_err_and(|x| x.to_string() == "Git config command exited with status code: 129")
436+
);
431437

432438
Ok(())
433439
}

0 commit comments

Comments
 (0)