Enable DTZ ruff rule set (flake8-datetimez)#585
Conversation
Add "DTZ" to ruff lint extend-select to enforce timezone-aware datetime usage. Fix DTZ005 violations by passing tz=datetime.UTC to datetime.now() calls used for relative age comparisons. Suppress DTZ007 violations with noqa comments where strptime parses legacy filename formats without timezone info. https://claude.ai/code/session_01ENWUz3LNWSDahEfcQeii1h
Add .replace(tzinfo=datetime.UTC) to strptime calls in micro/fs.py and lib/datetime.py, fixing latent bugs where naive datetimes were compared with timezone-aware now(tz=UTC). Keep noqa for status.py where the result is discarded (validation only). https://claude.ai/code/session_01ENWUz3LNWSDahEfcQeii1h
|
/review |
PR Review: Enable DTZ ruff rule set (flake8-datetimez)Clean, well-scoped PR. A few observations: Looks Good
Suggestions
No Issues Found
Overall this is a clean change. The suggestions above are minor polish -- the PR is correct as-is. |
Add "DTZ" to ruff lint extend-select to enforce timezone-aware datetime
usage. Fix DTZ005 violations by passing tz=datetime.UTC to
datetime.now() calls used for relative age comparisons. Suppress DTZ007
violations with noqa comments where strptime parses legacy filename
formats without timezone info.
https://claude.ai/code/session_01ENWUz3LNWSDahEfcQeii1h