Skip to content

Commit 02607ad

Browse files
committed
format
1 parent 7326dd6 commit 02607ad

File tree

2 files changed

+137
-15
lines changed

2 files changed

+137
-15
lines changed

CLAUDE.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,8 @@ Use syntax and helpers from the newest version of the language where it makes se
211211

212212
Where possible, use the LSP instead of grep to understand the code. Also use the LSP to check for errors after making changes.
213213

214+
After making changes, run the commands to build, test, lint, and format.
215+
214216
### Structure
215217

216218
- **Rust**: `src/` with nested modules, integration tests in `tests/` with shared helpers in `tests/common/`

rust/tests/git_commands_test.rs

Lines changed: 135 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -243,9 +243,33 @@ fn test_get_default_remote_prefers_upstream() {
243243
let cwd = dir.path().to_str().unwrap();
244244
write_package_json(dir.path(), None);
245245

246-
must_git(cwd, &["remote", "add", "first", "https://github.com/kenotron/workspace-tools.git"]);
247-
must_git(cwd, &["remote", "add", "origin", "https://github.com/ecraig12345/workspace-tools.git"]);
248-
must_git(cwd, &["remote", "add", "upstream", "https://github.com/microsoft/workspace-tools.git"]);
246+
must_git(
247+
cwd,
248+
&[
249+
"remote",
250+
"add",
251+
"first",
252+
"https://github.com/kenotron/workspace-tools.git",
253+
],
254+
);
255+
must_git(
256+
cwd,
257+
&[
258+
"remote",
259+
"add",
260+
"origin",
261+
"https://github.com/ecraig12345/workspace-tools.git",
262+
],
263+
);
264+
must_git(
265+
cwd,
266+
&[
267+
"remote",
268+
"add",
269+
"upstream",
270+
"https://github.com/microsoft/workspace-tools.git",
271+
],
272+
);
249273

250274
assert_eq!(get_default_remote(cwd), "upstream");
251275
}
@@ -257,8 +281,24 @@ fn test_get_default_remote_prefers_origin_over_other() {
257281
let cwd = dir.path().to_str().unwrap();
258282
write_package_json(dir.path(), None);
259283

260-
must_git(cwd, &["remote", "add", "first", "https://github.com/kenotron/workspace-tools.git"]);
261-
must_git(cwd, &["remote", "add", "origin", "https://github.com/microsoft/workspace-tools.git"]);
284+
must_git(
285+
cwd,
286+
&[
287+
"remote",
288+
"add",
289+
"first",
290+
"https://github.com/kenotron/workspace-tools.git",
291+
],
292+
);
293+
must_git(
294+
cwd,
295+
&[
296+
"remote",
297+
"add",
298+
"origin",
299+
"https://github.com/microsoft/workspace-tools.git",
300+
],
301+
);
262302

263303
assert_eq!(get_default_remote(cwd), "origin");
264304
}
@@ -270,8 +310,24 @@ fn test_get_default_remote_falls_back_to_first() {
270310
let cwd = dir.path().to_str().unwrap();
271311
write_package_json(dir.path(), None);
272312

273-
must_git(cwd, &["remote", "add", "first", "https://github.com/kenotron/workspace-tools.git"]);
274-
must_git(cwd, &["remote", "add", "second", "https://github.com/microsoft/workspace-tools.git"]);
313+
must_git(
314+
cwd,
315+
&[
316+
"remote",
317+
"add",
318+
"first",
319+
"https://github.com/kenotron/workspace-tools.git",
320+
],
321+
);
322+
must_git(
323+
cwd,
324+
&[
325+
"remote",
326+
"add",
327+
"second",
328+
"https://github.com/microsoft/workspace-tools.git",
329+
],
330+
);
275331

276332
assert_eq!(get_default_remote(cwd), "first");
277333
}
@@ -288,8 +344,24 @@ fn test_get_default_remote_matches_repository_string() {
288344
})),
289345
);
290346

291-
must_git(cwd, &["remote", "add", "first", "https://github.com/kenotron/workspace-tools.git"]);
292-
must_git(cwd, &["remote", "add", "second", "https://github.com/microsoft/workspace-tools.git"]);
347+
must_git(
348+
cwd,
349+
&[
350+
"remote",
351+
"add",
352+
"first",
353+
"https://github.com/kenotron/workspace-tools.git",
354+
],
355+
);
356+
must_git(
357+
cwd,
358+
&[
359+
"remote",
360+
"add",
361+
"second",
362+
"https://github.com/microsoft/workspace-tools.git",
363+
],
364+
);
293365

294366
assert_eq!(get_default_remote(cwd), "second");
295367
}
@@ -306,8 +378,24 @@ fn test_get_default_remote_matches_repository_object() {
306378
})),
307379
);
308380

309-
must_git(cwd, &["remote", "add", "first", "https://github.com/kenotron/workspace-tools.git"]);
310-
must_git(cwd, &["remote", "add", "second", "https://github.com/microsoft/workspace-tools.git"]);
381+
must_git(
382+
cwd,
383+
&[
384+
"remote",
385+
"add",
386+
"first",
387+
"https://github.com/kenotron/workspace-tools.git",
388+
],
389+
);
390+
must_git(
391+
cwd,
392+
&[
393+
"remote",
394+
"add",
395+
"second",
396+
"https://github.com/microsoft/workspace-tools.git",
397+
],
398+
);
311399

312400
assert_eq!(get_default_remote(cwd), "second");
313401
}
@@ -324,8 +412,24 @@ fn test_get_default_remote_ssh_remote_format() {
324412
})),
325413
);
326414

327-
must_git(cwd, &["remote", "add", "first", "git@github.com:kenotron/workspace-tools.git"]);
328-
must_git(cwd, &["remote", "add", "second", "git@github.com:microsoft/workspace-tools.git"]);
415+
must_git(
416+
cwd,
417+
&[
418+
"remote",
419+
"add",
420+
"first",
421+
"git@github.com:kenotron/workspace-tools.git",
422+
],
423+
);
424+
must_git(
425+
cwd,
426+
&[
427+
"remote",
428+
"add",
429+
"second",
430+
"git@github.com:microsoft/workspace-tools.git",
431+
],
432+
);
329433

330434
assert_eq!(get_default_remote(cwd), "second");
331435
}
@@ -342,8 +446,24 @@ fn test_get_default_remote_shorthand_format() {
342446
})),
343447
);
344448

345-
must_git(cwd, &["remote", "add", "first", "https://github.com/kenotron/workspace-tools.git"]);
346-
must_git(cwd, &["remote", "add", "second", "https://github.com/microsoft/workspace-tools.git"]);
449+
must_git(
450+
cwd,
451+
&[
452+
"remote",
453+
"add",
454+
"first",
455+
"https://github.com/kenotron/workspace-tools.git",
456+
],
457+
);
458+
must_git(
459+
cwd,
460+
&[
461+
"remote",
462+
"add",
463+
"second",
464+
"https://github.com/microsoft/workspace-tools.git",
465+
],
466+
);
347467

348468
assert_eq!(get_default_remote(cwd), "second");
349469
}

0 commit comments

Comments
 (0)