Skip to content

Commit 5bdd038

Browse files
committed
fix lint
Signed-off-by: kerthcet <kerthcet@gmail.com>
1 parent 750df6c commit 5bdd038

2 files changed

Lines changed: 18 additions & 9 deletions

File tree

alphatrion/server/graphql/resolvers.py

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77

88
from alphatrion import envs
99
from alphatrion.artifact import artifact
10+
from alphatrion.server.graphql.types import ArtifactFile
1011
from alphatrion.storage import runtime
1112
from alphatrion.storage.sql_models import (
1213
FINISHED_STATUS,
1314
Status,
1415
)
15-
from alphatrion.server.graphql.types import ArtifactFile
1616

1717
from .types import (
1818
AddUserToTeamInput,
@@ -376,9 +376,11 @@ async def list_artifact_files(
376376
# Determine content type based on file extension
377377
if filename.endswith(".json"):
378378
content_type = "application/json"
379-
elif filename.endswith(".txt") or filename.endswith(".log"):
380-
content_type = "text/plain"
381-
elif filename.endswith((".py", ".js", ".ts", ".tsx", ".jsx")):
379+
elif (
380+
filename.endswith(".txt")
381+
or filename.endswith(".log")
382+
or filename.endswith((".py", ".js", ".ts", ".tsx", ".jsx"))
383+
):
382384
content_type = "text/plain"
383385
else:
384386
content_type = "text/plain"
@@ -395,7 +397,10 @@ async def list_artifact_files(
395397

396398
@staticmethod
397399
async def get_artifact_content(
398-
team_id: str, tag: str, repo_name: str | None = None, filename: str | None = None
400+
team_id: str,
401+
tag: str,
402+
repo_name: str | None = None,
403+
filename: str | None = None,
399404
) -> ArtifactContent:
400405
"""Get artifact content from registry."""
401406
try:
@@ -431,9 +436,11 @@ async def get_artifact_content(
431436
# Determine content type based on file extension
432437
if actual_filename.endswith(".json"):
433438
content_type = "application/json"
434-
elif actual_filename.endswith(".txt") or actual_filename.endswith(".log"):
435-
content_type = "text/plain"
436-
elif actual_filename.endswith((".py", ".js", ".ts", ".tsx", ".jsx")):
439+
elif (
440+
actual_filename.endswith(".txt")
441+
or actual_filename.endswith(".log")
442+
or actual_filename.endswith((".py", ".js", ".ts", ".tsx", ".jsx"))
443+
):
437444
content_type = "text/plain"
438445
else:
439446
content_type = "text/plain"

alphatrion/server/graphql/schema.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,9 @@ async def artifact_content(
113113
repo_name: str,
114114
filename: str | None = None,
115115
) -> ArtifactContent:
116-
return await GraphQLResolvers.get_artifact_content(str(team_id), tag, repo_name, filename)
116+
return await GraphQLResolvers.get_artifact_content(
117+
str(team_id), tag, repo_name, filename
118+
)
117119

118120
# Dataset queries
119121
@strawberry.field

0 commit comments

Comments
 (0)