Skip to content

Ruff DTZ005/DTZ007: naive datetime findings #502

Closed

Description

@squid-protocol

Objective

Part of the ruff lint baseline cleanup (DTZ005/DTZ007 -- datetime.now() without a timezone (naive datetime); datetime.strptime() without a timezone). Chunked out of the larger sub-issue this replaces, so it's a manageable, self-contained pickup.

Findings

  • gitgalaxy/cobol_refractor_controller.py:280 (DTZ005) -- datetime.datetime.now() called without a tz argument
  • gitgalaxy/licensing.py:82 (DTZ007) -- Naive datetime constructed using datetime.datetime.strptime() without %z
  • gitgalaxy/licensing.py:83 (DTZ005) -- datetime.datetime.now() called without a tz argument
  • gitgalaxy/tools/cobol_to_cobol/cobol_jcl_forge.py:186 (DTZ005) -- datetime.datetime.now() called without a tz argument

Approach

These are a real correctness concern if any of these ever cross a timezone boundary -- check each call site's actual semantics (is it purely local wall-clock comparison, e.g. license expiry, or could it legitimately involve UTC/remote data) before deciding whether to make it tz-aware.

Fix in a small PR, removing resolved entries from tests/ruff_audit_baseline.json (see tests/ruff_audit.py's module docstring for the regen command).

Parent: #469

Activity

  1. added
    good first issue
    python
    refactor
    priority: low
    on Jul 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issuepriority: lowpythonrefactor

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions