autopep8 and whitespace changes

This commit is contained in:
Timothy Farrell 2025-12-28 14:18:33 -06:00
parent fc3f311e56
commit d6870f814e
4 changed files with 29 additions and 11 deletions

19
.vscode/tasks.json vendored
View File

@ -26,5 +26,22 @@
"problemMatcher": [ "problemMatcher": [
"$python" "$python"
] ]
} ] },
{
"label": "AutoPEP8 Check",
"type": "shell",
"command": "uv run autopep8 app/**/*.py --diff",
"problemMatcher": [
"$python"
]
},
{
"label": "AutoPEP8 Fix",
"type": "shell",
"command": "uv run autopep8 app/**/*.py --in-place",
"problemMatcher": [
"$python"
]
}
]
} }

View File

@ -6,28 +6,29 @@ from pydantic_settings import BaseSettings
class Settings(BaseSettings): class Settings(BaseSettings):
"""Application settings following 12-factor app principles.""" """Application settings following 12-factor app principles."""
# Server settings # Server settings
host: str = Field(default="0.0.0.0", alias="HOST") host: str = Field(default="0.0.0.0", alias="HOST")
port: int = Field(default=8000, alias="PORT") port: int = Field(default=8000, alias="PORT")
debug: bool = Field(default=False, alias="DEBUG") debug: bool = Field(default=False, alias="DEBUG")
log_level: str = Field(default="INFO", alias="LOG_LEVEL") log_level: str = Field(default="INFO", alias="LOG_LEVEL")
# Database settings # Database settings
oracle_user: str = Field(alias="ORACLE_USER") oracle_user: str = Field(alias="ORACLE_USER")
oracle_password: str = Field(alias="ORACLE_PASSWORD") oracle_password: str = Field(alias="ORACLE_PASSWORD")
oracle_dsn: str = Field(alias="ORACLE_DSN") oracle_dsn: str = Field(alias="ORACLE_DSN")
# Sentry settings # Sentry settings
sentry_dsn: str | None = Field(default=None, alias="SENTRY_DSN") sentry_dsn: str | None = Field(default=None, alias="SENTRY_DSN")
# Datadog settings # Datadog settings
dd_service: str = Field(default="loapi", alias="DD_SERVICE") dd_service: str = Field(default="loapi", alias="DD_SERVICE")
dd_env: str = Field(default="development", alias="DD_ENV") dd_env: str = Field(default="development", alias="DD_ENV")
dd_version: str = Field(default="1.0.0", alias="DD_VERSION") dd_version: str = Field(default="1.0.0", alias="DD_VERSION")
class Config: class Config:
env_file = ".env" env_file = ".env"
case_sensitive = False case_sensitive = False
settings = Settings() # type:ignore[call-arg] settings = Settings() # type:ignore[call-arg]

View File

@ -39,7 +39,7 @@ def get_db() -> Generator[Session, None]:
class DatabaseService: class DatabaseService:
"""Database service for health checks and utilities.""" """Database service for health checks and utilities."""
@staticmethod @staticmethod
def health_check() -> bool: def health_check() -> bool:
"""Check database connectivity.""" """Check database connectivity."""

View File

@ -9,16 +9,16 @@ router = APIRouter()
@router.get("/health-check") @router.get("/health-check")
async def health_check() -> dict[str, str]: async def health_check() -> dict[str, str]:
"""Comprehensive health check endpoint.""" """Comprehensive health check endpoint."""
# Check database connectivity # Check database connectivity
db_healthy = DatabaseService.health_check() db_healthy = DatabaseService.health_check()
status = "healthy" if db_healthy else "unhealthy" status = "healthy" if db_healthy else "unhealthy"
result = { result = {
"status": status, "status": status,
"service": "loapi", "service": "loapi",
"database": "connected" if db_healthy else "disconnected" "database": "connected" if db_healthy else "disconnected"
} }
return result return result