Skip to content

Commit 3f2c972

Browse files
linters - my thing is not set up to autolint correctly
1 parent 6aa248e commit 3f2c972

5 files changed

Lines changed: 72 additions & 79 deletions

File tree

packages/js-sdk/src/sandbox/git/index.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export interface GitRequestOpts
3939
CommandStartOpts,
4040
'envs' | 'user' | 'cwd' | 'timeoutMs' | 'requestTimeoutMs'
4141
>
42-
> { }
42+
> {}
4343

4444
/**
4545
* Options for cloning a repository.
@@ -284,7 +284,7 @@ export interface GitDangerouslyAuthenticateOpts extends GitRequestOpts {
284284
* Module for running git operations in the sandbox.
285285
*/
286286
export class Git {
287-
constructor(private readonly commands: Commands) { }
287+
constructor(private readonly commands: Commands) {}
288288

289289
/**
290290
* Clone a git repository into the sandbox.
@@ -1044,7 +1044,6 @@ export class Git {
10441044
return false
10451045
}
10461046
}
1047-
10481047
}
10491048

10501049
export type {

packages/js-sdk/tests/sandbox/git/config.test.ts

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -61,24 +61,27 @@ sandboxTest('git setConfig updates local config', async ({ sandbox }) => {
6161
}
6262
})
6363

64-
sandboxTest('git configureUser sets global user config', async ({ sandbox }) => {
65-
await sandbox.git.configureUser(AUTHOR_NAME, AUTHOR_EMAIL)
64+
sandboxTest(
65+
'git configureUser sets global user config',
66+
async ({ sandbox }) => {
67+
await sandbox.git.configureUser(AUTHOR_NAME, AUTHOR_EMAIL)
6668

67-
const name = (
68-
await sandbox.commands.run('git config --global --get user.name')
69-
).stdout.trim()
70-
const email = (
71-
await sandbox.commands.run('git config --global --get user.email')
72-
).stdout.trim()
73-
const configuredName = await sandbox.git.getConfig('user.name', {
74-
scope: 'global',
75-
})
76-
const configuredEmail = await sandbox.git.getConfig('user.email', {
77-
scope: 'global',
78-
})
69+
const name = (
70+
await sandbox.commands.run('git config --global --get user.name')
71+
).stdout.trim()
72+
const email = (
73+
await sandbox.commands.run('git config --global --get user.email')
74+
).stdout.trim()
75+
const configuredName = await sandbox.git.getConfig('user.name', {
76+
scope: 'global',
77+
})
78+
const configuredEmail = await sandbox.git.getConfig('user.email', {
79+
scope: 'global',
80+
})
7981

80-
expect(name).toBe(AUTHOR_NAME)
81-
expect(email).toBe(AUTHOR_EMAIL)
82-
expect(configuredName).toBe(AUTHOR_NAME)
83-
expect(configuredEmail).toBe(AUTHOR_EMAIL)
84-
})
82+
expect(name).toBe(AUTHOR_NAME)
83+
expect(email).toBe(AUTHOR_EMAIL)
84+
expect(configuredName).toBe(AUTHOR_NAME)
85+
expect(configuredEmail).toBe(AUTHOR_EMAIL)
86+
}
87+
)

packages/js-sdk/tests/sandbox/git/remote.test.ts

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,20 @@ import {
88
startGitDaemon,
99
} from './helpers.js'
1010

11-
sandboxTest('git remoteGet returns undefined for missing remote', async ({ sandbox }) => {
12-
const baseDir = await createBaseDir(sandbox)
11+
sandboxTest(
12+
'git remoteGet returns undefined for missing remote',
13+
async ({ sandbox }) => {
14+
const baseDir = await createBaseDir(sandbox)
1315

14-
try {
15-
const repoPath = await createRepo(sandbox, baseDir)
16-
const missingUrl = await sandbox.git.remoteGet(repoPath, 'origin')
17-
expect(missingUrl).toBeUndefined()
18-
} finally {
19-
await cleanupBaseDir(sandbox, baseDir)
16+
try {
17+
const repoPath = await createRepo(sandbox, baseDir)
18+
const missingUrl = await sandbox.git.remoteGet(repoPath, 'origin')
19+
expect(missingUrl).toBeUndefined()
20+
} finally {
21+
await cleanupBaseDir(sandbox, baseDir)
22+
}
2023
}
21-
})
24+
)
2225

2326
sandboxTest('git remoteAdd adds remote', async ({ sandbox }) => {
2427
const baseDir = await createBaseDir(sandbox)

packages/python-sdk/e2b/sandbox_async/git.py

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,21 @@
77
)
88
from e2b.sandbox.commands.command_handle import CommandExitException
99
from e2b.sandbox.git_utils import (
10-
GitBranches,
11-
GitStatus,
12-
build_auth_error_message,
13-
build_git_command,
14-
build_push_args,
15-
build_upstream_error_message,
16-
is_auth_failure,
17-
is_missing_upstream,
18-
parse_git_branches,
19-
parse_git_status,
20-
resolve_config_scope,
21-
shell_escape,
22-
strip_credentials,
23-
derive_repo_dir_from_url,
24-
with_credentials,
10+
GitBranches,
11+
GitStatus,
12+
build_auth_error_message,
13+
build_git_command,
14+
build_push_args,
15+
build_upstream_error_message,
16+
is_auth_failure,
17+
is_missing_upstream,
18+
parse_git_branches,
19+
parse_git_status,
20+
resolve_config_scope,
21+
shell_escape,
22+
strip_credentials,
23+
derive_repo_dir_from_url,
24+
with_credentials,
2525
)
2626
from e2b.sandbox_async.commands.command import Commands
2727

@@ -324,9 +324,7 @@ async def attempt_clone(
324324
except CommandExitException as err:
325325
if is_auth_failure(err):
326326
raise GitAuthException(
327-
build_auth_error_message(
328-
"clone", bool(username) and not password
329-
)
327+
build_auth_error_message("clone", bool(username) and not password)
330328
) from err
331329
raise
332330

@@ -776,9 +774,7 @@ async def push(
776774
except CommandExitException as err:
777775
if is_auth_failure(err):
778776
raise GitAuthException(
779-
build_auth_error_message(
780-
"push", bool(username) and not password
781-
)
777+
build_auth_error_message("push", bool(username) and not password)
782778
) from err
783779
if is_missing_upstream(err):
784780
raise GitUpstreamException(
@@ -867,9 +863,7 @@ def build_args(remote_name: Optional[str] = None) -> List[str]:
867863
except CommandExitException as err:
868864
if is_auth_failure(err):
869865
raise GitAuthException(
870-
build_auth_error_message(
871-
"pull", bool(username) and not password
872-
)
866+
build_auth_error_message("pull", bool(username) and not password)
873867
) from err
874868
if is_missing_upstream(err):
875869
raise GitUpstreamException(

packages/python-sdk/e2b/sandbox_sync/git.py

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
from typing import Dict, List, Optional
22

33
from e2b.sandbox.git_utils import (
4-
GitBranches,
5-
GitStatus,
6-
build_auth_error_message,
7-
build_git_command,
8-
build_push_args,
9-
build_upstream_error_message,
10-
is_auth_failure,
11-
is_missing_upstream,
12-
parse_git_branches,
13-
parse_git_status,
14-
resolve_config_scope,
15-
shell_escape,
16-
strip_credentials,
17-
derive_repo_dir_from_url,
18-
with_credentials,
4+
GitBranches,
5+
GitStatus,
6+
build_auth_error_message,
7+
build_git_command,
8+
build_push_args,
9+
build_upstream_error_message,
10+
is_auth_failure,
11+
is_missing_upstream,
12+
parse_git_branches,
13+
parse_git_status,
14+
resolve_config_scope,
15+
shell_escape,
16+
strip_credentials,
17+
derive_repo_dir_from_url,
18+
with_credentials,
1919
)
2020
from e2b.exceptions import (
2121
GitAuthException,
@@ -322,9 +322,7 @@ def attempt_clone(auth_username: Optional[str], auth_password: Optional[str]):
322322
except CommandExitException as err:
323323
if is_auth_failure(err):
324324
raise GitAuthException(
325-
build_auth_error_message(
326-
"clone", bool(username) and not password
327-
)
325+
build_auth_error_message("clone", bool(username) and not password)
328326
) from err
329327
raise
330328

@@ -860,9 +858,7 @@ def push(
860858
except CommandExitException as err:
861859
if is_auth_failure(err):
862860
raise GitAuthException(
863-
build_auth_error_message(
864-
"push", bool(username) and not password
865-
)
861+
build_auth_error_message("push", bool(username) and not password)
866862
) from err
867863
if is_missing_upstream(err):
868864
raise GitUpstreamException(
@@ -948,9 +944,7 @@ def build_args(remote_name: Optional[str] = None) -> List[str]:
948944
except CommandExitException as err:
949945
if is_auth_failure(err):
950946
raise GitAuthException(
951-
build_auth_error_message(
952-
"pull", bool(username) and not password
953-
)
947+
build_auth_error_message("pull", bool(username) and not password)
954948
) from err
955949
if is_missing_upstream(err):
956950
raise GitUpstreamException(

0 commit comments

Comments
 (0)