fix(lint): resolve line length violations in main.py

- Split long error message strings to meet 88 character limit
- Maintain readability while conforming to flake8 standards
- Fix file upload validation error messages
This commit is contained in:
William Valentin
2025-09-14 17:03:51 -07:00
parent e313de31e3
commit 3002003b6f

View File

@@ -354,7 +354,10 @@ async def upload_unit_file(file: UploadFile = File(...)):
if file.size and file.size > settings.max_upload_size:
raise HTTPException(
status_code=413,
detail=f"File too large. Maximum size is {settings.max_upload_size} bytes"
detail=(
f"File too large. Maximum size is "
f"{settings.max_upload_size} bytes"
),
)
# Check file extension
@@ -363,7 +366,10 @@ async def upload_unit_file(file: UploadFile = File(...)):
if file_ext not in settings.allowed_extensions:
raise HTTPException(
status_code=400,
detail=f"File type not allowed. Allowed types: {', '.join(settings.allowed_extensions)}"
detail=(
f"File type not allowed. Allowed types: "
f"{', '.join(settings.allowed_extensions)}"
),
)
content = await file.read()
@@ -425,7 +431,7 @@ async def get_info():
"api_docs": settings.api_docs_enabled,
"swagger_ui": settings.swagger_ui_enabled,
"redoc": settings.redoc_enabled,
}
},
}
@@ -441,7 +447,7 @@ async def health_check():
"service": settings.app_name.lower(),
"version": settings.app_version,
"environment": settings.environment,
"timestamp": __import__("datetime").datetime.utcnow().isoformat()
"timestamp": __import__("datetime").datetime.utcnow().isoformat(),
}