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:
copilot-swe-agent[bot]
2026-03-23 10:48:16 +00:00
parent a918421945
commit 27c50e49cf
11 changed files with 98 additions and 59 deletions
+4 -4
View File
@@ -148,12 +148,12 @@ class MailProcessor:
Fetch emails from the mail server.
Returns list of raw email data.
"""
max_count = max_count or self.account.max_emails_per_check
effective_max: int = max_count if max_count is not None else self.account.max_emails_per_check # type: ignore[assignment]
if self.account.protocol in [MailProtocol.POP3, MailProtocol.POP3_SSL]:
return await self._fetch_pop3_emails(max_count)
return await self._fetch_pop3_emails(effective_max)
else:
return await self._fetch_imap_emails(max_count)
return await self._fetch_imap_emails(effective_max)
async def _fetch_pop3_emails(self, max_count: int) -> List[bytes]:
"""Fetch emails via POP3"""
@@ -394,7 +394,7 @@ class MailServerAutoDetect:
"""Auto-detect mail server settings based on email domain"""
# Common mail server configurations
KNOWN_PROVIDERS = {
KNOWN_PROVIDERS: Dict[str, Dict[str, Any]] = {
"gmail.com": {
"name": "Gmail",
"pop3_ssl": {"host": "pop.gmail.com", "port": 995},