Fix style-check errors

This commit is contained in:
Mikhail f. Shiryaev 2023-10-04 13:53:55 +02:00
parent 16a864171d
commit d94228b718
No known key found for this signature in database
GPG Key ID: 4B02ED204C7D93F4
3 changed files with 9 additions and 5 deletions

View File

@ -9,7 +9,8 @@ check_untyped_defs = True
disallow_untyped_decorators = True
no_implicit_optional = True
warn_redundant_casts = True
warn_unused_ignores = True
# Unused ignores differs from version to version, so too many noizes
warn_unused_ignores = False
warn_return_any = True
no_implicit_reexport = True
strict_equality = True

View File

@ -289,7 +289,9 @@ close it.
"Checking if cherry-pick PR #%s needs to be pinged",
self.cherrypick_pr.number,
)
since_updated = datetime.now() - self.cherrypick_pr.updated_at
# The `updated_at` is Optional[datetime]
cherrypick_updated_at = self.cherrypick_pr.updated_at or datetime.now()
since_updated = datetime.now() - cherrypick_updated_at
since_updated_str = (
f"{since_updated.days}d{since_updated.seconds // 3600}"
f"h{since_updated.seconds // 60 % 60}m{since_updated.seconds % 60}s"
@ -298,7 +300,7 @@ close it.
logging.info(
"The cherry-pick PR was updated at %s %s ago, "
"waiting for the next running",
self.cherrypick_pr.updated_at.isoformat(),
cherrypick_updated_at.isoformat(),
since_updated_str,
)
return

View File

@ -1,16 +1,17 @@
#!/usr/bin/env python3
import logging
from dataclasses import dataclass
from typing import Any, Dict, List, Optional
from typing import Any, Dict, List, Optional, Union
import boto3 # type: ignore
from github import Github
from github.AuthenticatedUser import AuthenticatedUser
from github.NamedUser import NamedUser
@dataclass
class Token:
user: AuthenticatedUser
user: Union[AuthenticatedUser, NamedUser]
value: str
rest: int