Fix all mypy and eslint errors, add copilot lint instructions
Backend (mypy - 56 errors fixed): - database.py: Fix async generator return type to AsyncGenerator - database_models.py: Add type annotations for SQLEnum columns - middleware.py: Use explicit Optional for exempt_paths parameter - mail_processor.py: Fix type narrowing in fetch_emails, add Dict type annotation for KNOWN_PROVIDERS - users.py, auth.py, providers.py, tasks.py: Add type: ignore comments for SQLAlchemy Column assignment patterns Frontend (eslint - 3 errors, 2 warnings fixed): - login/page.tsx: Replace any with unknown + type narrowing, prefix unused vars with underscore - register/page.tsx: Replace any with unknown + type narrowing Add .github/copilot-instructions.md with lint-check requirements Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com> Agent-Logs-Url: https://github.com/christianlouis/pop_puller_to_gmail/sessions/dac7ab78-fe27-4fe4-890f-32c6c1c6d881
This commit is contained in:
@@ -72,7 +72,7 @@ async def login(
|
||||
)
|
||||
|
||||
# Verify password
|
||||
if not verify_password(form_data.password, user.hashed_password):
|
||||
if not verify_password(form_data.password, user.hashed_password): # type: ignore[arg-type]
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_401_UNAUTHORIZED,
|
||||
detail="Incorrect email or password",
|
||||
@@ -86,7 +86,7 @@ async def login(
|
||||
)
|
||||
|
||||
# Update last login
|
||||
user.last_login_at = datetime.utcnow()
|
||||
user.last_login_at = datetime.utcnow() # type: ignore[assignment]
|
||||
await db.commit()
|
||||
|
||||
# Create tokens
|
||||
@@ -129,11 +129,11 @@ async def google_oauth(
|
||||
if user:
|
||||
# Update Google ID if not set
|
||||
if not user.google_id:
|
||||
user.google_id = google_id
|
||||
user.oauth_provider = "google"
|
||||
user.google_id = google_id # type: ignore[assignment]
|
||||
user.oauth_provider = "google" # type: ignore[assignment]
|
||||
|
||||
# Update last login
|
||||
user.last_login_at = datetime.utcnow()
|
||||
user.last_login_at = datetime.utcnow() # type: ignore[assignment]
|
||||
|
||||
logger.info(f"Existing user logged in with Google: {user.email}")
|
||||
else:
|
||||
|
||||
@@ -201,11 +201,11 @@ async def save_gmail_credential(
|
||||
|
||||
if existing:
|
||||
# Update existing
|
||||
existing.gmail_email = credential_in.gmail_email
|
||||
existing.encrypted_access_token = encrypted_access
|
||||
existing.encrypted_refresh_token = encrypted_refresh
|
||||
existing.is_valid = True
|
||||
existing.last_verified_at = datetime.utcnow()
|
||||
existing.gmail_email = credential_in.gmail_email # type: ignore[assignment]
|
||||
existing.encrypted_access_token = encrypted_access # type: ignore[assignment]
|
||||
existing.encrypted_refresh_token = encrypted_refresh # type: ignore[assignment]
|
||||
existing.is_valid = True # type: ignore[assignment]
|
||||
existing.last_verified_at = datetime.utcnow() # type: ignore[assignment]
|
||||
await db.commit()
|
||||
await db.refresh(existing)
|
||||
return existing
|
||||
|
||||
@@ -27,9 +27,9 @@ async def update_current_user_profile(
|
||||
):
|
||||
"""Update current user profile"""
|
||||
if user_update.email:
|
||||
current_user.email = user_update.email
|
||||
current_user.email = user_update.email # type: ignore[assignment]
|
||||
if user_update.full_name:
|
||||
current_user.full_name = user_update.full_name
|
||||
current_user.full_name = user_update.full_name # type: ignore[assignment]
|
||||
|
||||
await db.commit()
|
||||
await db.refresh(current_user)
|
||||
|
||||
Reference in New Issue
Block a user