Skip to content

Commit

Permalink
chore: formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
LatentDream committed Apr 16, 2024
1 parent afddadf commit 5eed02d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 16 deletions.
10 changes: 5 additions & 5 deletions captain/routes/test_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,15 @@ async def checkout(url: Annotated[str, Header()], commit_hash: str):


def get_profile_path_from_url(profiles_path: str, url: str):
""" Get the profile directory name from the url """
"""Get the profile directory name from the url"""
profile_name = url.split("/")[-1].strip(".git")
logging.info(f"Profile name: {profile_name}")
profile_root = os.path.join(profiles_path, profile_name)
return profile_root


def verify_git_install():
""" Verify if git is installed on the system """
"""Verify if git is installed on the system"""
cmd = ["git", "--version"]
res = subprocess.run(cmd, capture_output=True)
if res.returncode != 0:
Expand All @@ -120,7 +120,7 @@ def get_profiles_dir():


def get_commit_hash(profile_path: str):
""" Get the commit hash of the current env. """
"""Get the commit hash of the current env."""
cmd = ["git", "-C", profile_path, "rev-parse", "HEAD"]
res = subprocess.run(cmd, capture_output=True)
if res.returncode != 0:
Expand All @@ -131,9 +131,9 @@ def get_commit_hash(profile_path: str):


def update_to_origin_main(profile_path: str):
""" Update the local repo to the lastest version """
"""Update the local repo to the lastest version"""
logging.info("Updating the repo to the origin main")

# Verify the repo is clean (no changes so the user doesn't lose any work)
cmd = ["git", "-C", profile_path, "status", "--porcelain"]
res = subprocess.run(cmd, capture_output=True)
Expand Down
1 change: 0 additions & 1 deletion src/renderer/hooks/useTestSequencerProject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@ export const useLoadTestProfile = () => {
success: () => `Test Profile imported`,
error: (e) => `${e}`,
});

};

return handleImport;
Expand Down
14 changes: 8 additions & 6 deletions src/renderer/hooks/useTestSequencerState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -426,13 +426,15 @@ export function useSequencerState() {
toast.warning("Stopping sequencer after this test.");
sender(testSequenceStopRequest(tree));
// Paused test and never not yet run
setElements(produce(elements, (draft) => {
for (const el of draft) {
if (el.type === "test" && el.status === "paused") {
el.status = "pending";
setElements(
produce(elements, (draft) => {
for (const el of draft) {
if (el.type === "test" && el.status === "paused") {
el.status = "pending";
}
}
}
}));
}),
);
setIsLocked(false);
}

Expand Down
5 changes: 1 addition & 4 deletions src/renderer/lib/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,7 @@ export type Part = z.infer<typeof Part>;
const Project = z.object({
label: z.string(),
value: z.string(),
repoUrl: z
.string()
.nullable()
.transform((value) => value ?? ""),
repoUrl: z.string().default(""),
part: Part,
productName: z.string(),
});
Expand Down

0 comments on commit 5eed02d

Please sign in to comment.