mirror of
https://github.com/Sea-Haven-Industries/front-integrations.git
synced 2026-09-30 07:13:12 +00:00
fix(lint): resolve ruff 0.16 DTZ007/BLE001 failures blocking CI (#33)
CI installs unpinned latest ruff; 0.16.0 flags two pre-existing lines, failing ci / ci on every PR (including safe Dependabot bumps #31/#32). - sla_monitor: parse START_DATE with date.fromisoformat() instead of a naive strptime().date() round-trip (identical result, no naive datetime) - user_sync: keep the deliberate per-user blanket catch (one failed update must not abort the sync) with a justified noqa: BLE001
This commit is contained in:
parent
b5bd1093e5
commit
71c63b7434
2 changed files with 3 additions and 3 deletions
|
|
@ -2,7 +2,7 @@ import json
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import time
|
import time
|
||||||
from datetime import datetime, timedelta, timezone
|
from datetime import date, datetime, timedelta, timezone
|
||||||
from urllib import error, parse, request
|
from urllib import error, parse, request
|
||||||
from zoneinfo import ZoneInfo
|
from zoneinfo import ZoneInfo
|
||||||
|
|
||||||
|
|
@ -366,7 +366,7 @@ def handler(event, context):
|
||||||
now_et = now.astimezone(EASTERN)
|
now_et = now.astimezone(EASTERN)
|
||||||
|
|
||||||
if start_date:
|
if start_date:
|
||||||
start = datetime.strptime(start_date, "%Y-%m-%d").date()
|
start = date.fromisoformat(start_date)
|
||||||
if now_et.date() < start:
|
if now_et.date() < start:
|
||||||
logger.info("Before start date %s, skipping", start_date)
|
logger.info("Before start date %s, skipping", start_date)
|
||||||
return {"skipped": True, "reason": "before_start_date"}
|
return {"skipped": True, "reason": "before_start_date"}
|
||||||
|
|
|
||||||
|
|
@ -191,7 +191,7 @@ def handler(event, context):
|
||||||
logger.info("Skipped %s - not a Front teammate", email)
|
logger.info("Skipped %s - not a Front teammate", email)
|
||||||
summary["not_in_front"] += 1
|
summary["not_in_front"] += 1
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e: # noqa: BLE001 - per-user isolation: one failed update must not abort the sync
|
||||||
logger.error("Error updating %s: %s", email, e)
|
logger.error("Error updating %s: %s", email, e)
|
||||||
summary["errors"] += 1
|
summary["errors"] += 1
|
||||||
summary["error_details"].append({"email": email, "message": str(e)})
|
summary["error_details"].append({"email": email, "message": str(e)})
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue