From 78f67bde1877ffd8c2dfaf0a66f828c92e4b8c34 Mon Sep 17 00:00:00 2001 From: Adam Moussa Date: Tue, 28 Jul 2026 11:55:43 -0400 Subject: [PATCH] fix(lint): resolve ruff 0.16 DTZ007/BLE001 failures blocking CI 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 --- src/sla_monitor/app.py | 4 ++-- src/user_sync/app.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sla_monitor/app.py b/src/sla_monitor/app.py index a5ac69e..657af70 100644 --- a/src/sla_monitor/app.py +++ b/src/sla_monitor/app.py @@ -2,7 +2,7 @@ import json import logging import os import time -from datetime import datetime, timedelta, timezone +from datetime import date, datetime, timedelta, timezone from urllib import error, parse, request from zoneinfo import ZoneInfo @@ -366,7 +366,7 @@ def handler(event, context): now_et = now.astimezone(EASTERN) if start_date: - start = datetime.strptime(start_date, "%Y-%m-%d").date() + start = date.fromisoformat(start_date) if now_et.date() < start: logger.info("Before start date %s, skipping", start_date) return {"skipped": True, "reason": "before_start_date"} diff --git a/src/user_sync/app.py b/src/user_sync/app.py index a3e08bf..d15f766 100644 --- a/src/user_sync/app.py +++ b/src/user_sync/app.py @@ -191,7 +191,7 @@ def handler(event, context): logger.info("Skipped %s - not a Front teammate", email) 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) summary["errors"] += 1 summary["error_details"].append({"email": email, "message": str(e)})