Enable DTZ004: use datetime.fromtimestamp with UTC timezone

This commit is contained in:
Krzysztof kuhy Rudnicki 2025-11-30 15:14:14 +01:00
parent 732e6b56d6
commit 0ad0894828
2 changed files with 2 additions and 3 deletions

View File

@ -97,8 +97,8 @@ def run_bot(log_level: str = "INFO", decline_correspondence: bool = False) -> No
"createdAtDate"
)
if created_ms:
game_date_iso = datetime.datetime.utcfromtimestamp(
int(created_ms) / 1000
game_date_iso = datetime.datetime.fromtimestamp(
int(created_ms) / 1000, tz=datetime.timezone.utc
).strftime("%Y.%m.%d")
except Exception:
pass

View File

@ -66,7 +66,6 @@ ignore = [
"S110", # try-except-pass - common pattern in scripts
"S112", # try-except-continue - acceptable pattern
"DTZ005", # datetime.now without tz - acceptable for local scripts
"DTZ004", # datetime.utcfromtimestamp - acceptable
"PERF401", # manual-list-comprehension - style preference
"RUF005", # collection-literal-concatenation - style preference
"SIM102", # collapsible-if - style preference