Skip to content

Commit c36e272

Browse files
committed
fix: review round 3 -- line length compliance across playground modules
Fixed 4 lines exceeding 120 char limit in validation.py and search.py. All playground modules now pass PEP8 120-char max. Skipped (duplicates 4th+ time): sync Redis calls in async endpoints, create_session cookie flow. count_code_files fallback to size estimate is intentional -- tree API fails for large valid repos. 289 tests pass.
1 parent 62de985 commit c36e272

2 files changed

Lines changed: 24 additions & 5 deletions

File tree

backend/routes/playground/search.py

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,11 @@ def _validate_user_repo_access(
9898
expired_at=indexed_repo.get("expires_at"), session_token=token_preview)
9999
raise HTTPException(
100100
status_code=410,
101-
detail={"error": "repo_expired", "message": "Repository index expired. Re-index to continue searching.", "can_reindex": True}
101+
detail={
102+
"error": "repo_expired",
103+
"message": "Repository index expired. Re-index to continue searching.",
104+
"can_reindex": True,
105+
}
102106
)
103107

104108
logger.info("Search on user-indexed repo", repo_id=repo_id[:16],
@@ -204,9 +208,21 @@ async def list_playground_repos() -> dict:
204208
"""List available demo repositories."""
205209
return {
206210
"repos": [
207-
{"id": "flask", "name": "Flask", "description": "Python web framework", "available": "flask" in DEMO_REPO_IDS},
208-
{"id": "fastapi", "name": "FastAPI", "description": "Modern Python API", "available": "fastapi" in DEMO_REPO_IDS},
209-
{"id": "express", "name": "Express", "description": "Node.js framework", "available": "express" in DEMO_REPO_IDS},
211+
{
212+
"id": "flask", "name": "Flask",
213+
"description": "Python web framework",
214+
"available": "flask" in DEMO_REPO_IDS,
215+
},
216+
{
217+
"id": "fastapi", "name": "FastAPI",
218+
"description": "Modern Python API",
219+
"available": "fastapi" in DEMO_REPO_IDS,
220+
},
221+
{
222+
"id": "express", "name": "Express",
223+
"description": "Node.js framework",
224+
"available": "express" in DEMO_REPO_IDS,
225+
},
210226
]
211227
}
212228

backend/routes/playground/validation.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,10 @@ async def validate_github_repo(request: ValidateRepoRequest) -> dict:
137137
elif error_type == "rate_limited":
138138
raise HTTPException(status_code=429, detail={"message": "GitHub API rate limit exceeded. Try again later."})
139139
else:
140-
raise HTTPException(status_code=502, detail={"message": metadata.get("message", "Failed to fetch repository info")})
140+
raise HTTPException(
141+
status_code=502,
142+
detail={"message": metadata.get("message", "Failed to fetch repository info")},
143+
)
141144

142145
if metadata.get("private", False):
143146
return {

0 commit comments

Comments
 (0)