diff --git a/pyproject.toml b/pyproject.toml index 65ca2fb..e887c12 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,7 +48,7 @@ line-length = 88 target-version = "py311" [tool.ruff.lint] -select = ["E4", "E7", "E9", "F", "UP", "S", "ANN", "C4", "I", "RUF", "SIM", "PLR", "ERA", "RET", "B"] +select = ["E4", "E7", "E9", "F", "UP", "S", "ANN", "C4", "I", "RUF", "SIM", "PLR", "ERA", "RET", "B", "A"] # select = ["ALL"] ignore = ["ANN003", "ANN401", "D", "COM"] diff --git a/src/pythonxbox/api/provider/catalog/__init__.py b/src/pythonxbox/api/provider/catalog/__init__.py index 5495e75..fd9d005 100644 --- a/src/pythonxbox/api/provider/catalog/__init__.py +++ b/src/pythonxbox/api/provider/catalog/__init__.py @@ -40,7 +40,7 @@ async def get_products( async def get_product_from_alternate_id( self, - id: str, + id: str, # noqa: A002 id_type: AlternateIdType, fields: FieldsTemplate = FieldsTemplate.DETAILS, top: int = 25, diff --git a/src/pythonxbox/common/ratelimits/__init__.py b/src/pythonxbox/common/ratelimits/__init__.py index 5b50cbb..c564853 100644 --- a/src/pythonxbox/common/ratelimits/__init__.py +++ b/src/pythonxbox/common/ratelimits/__init__.py @@ -59,7 +59,7 @@ class SingleRateLimit(RateLimit): This class is mainly used by the CombinedRateLimit class. """ - def __init__(self, time_period: TimePeriod, type: LimitType, limit: int) -> None: + def __init__(self, time_period: TimePeriod, type: LimitType, limit: int) -> None: # noqa: A002 self.__time_period = time_period self.__type = type self.__limit = limit @@ -148,7 +148,7 @@ class CombinedRateLimit(RateLimit): """ - def __init__(self, *parsed_limits: ParsedRateLimit, type: LimitType) -> None: + def __init__(self, *parsed_limits: ParsedRateLimit, type: LimitType) -> None: # noqa: A002 # *parsed_limits is a tuple # Create a SingleRateLimit instance for each limit diff --git a/src/pythonxbox/common/request_signer.py b/src/pythonxbox/common/request_signer.py index bb58fd7..bbd8b17 100644 --- a/src/pythonxbox/common/request_signer.py +++ b/src/pythonxbox/common/request_signer.py @@ -146,9 +146,8 @@ def _sign_raw( @staticmethod def _hash(data: bytes) -> bytes: - hash = hashlib.sha256() - hash.update(data) - return hash.digest() + """Compute SHA-256 hash of the input data.""" + return hashlib.sha256(data).digest() @staticmethod def _concat_data_to_sign( # noqa: PLR0913