Skip to content

Commit 42256c3

Browse files
authored
Enable flake8-builtins (A) and apply fixes/ignores (#45)
1 parent 078b580 commit 42256c3

File tree

4 files changed

+6
-7
lines changed

4 files changed

+6
-7
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ line-length = 88
4848
target-version = "py311"
4949

5050
[tool.ruff.lint]
51-
select = ["E4", "E7", "E9", "F", "UP", "S", "ANN", "C4", "I", "RUF", "SIM", "PLR", "ERA", "RET", "B"]
51+
select = ["E4", "E7", "E9", "F", "UP", "S", "ANN", "C4", "I", "RUF", "SIM", "PLR", "ERA", "RET", "B", "A"]
5252
# select = ["ALL"]
5353
ignore = ["ANN003", "ANN401", "D", "COM"]
5454

src/pythonxbox/api/provider/catalog/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ async def get_products(
4040

4141
async def get_product_from_alternate_id(
4242
self,
43-
id: str,
43+
id: str, # noqa: A002
4444
id_type: AlternateIdType,
4545
fields: FieldsTemplate = FieldsTemplate.DETAILS,
4646
top: int = 25,

src/pythonxbox/common/ratelimits/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class SingleRateLimit(RateLimit):
5959
This class is mainly used by the CombinedRateLimit class.
6060
"""
6161

62-
def __init__(self, time_period: TimePeriod, type: LimitType, limit: int) -> None:
62+
def __init__(self, time_period: TimePeriod, type: LimitType, limit: int) -> None: # noqa: A002
6363
self.__time_period = time_period
6464
self.__type = type
6565
self.__limit = limit
@@ -148,7 +148,7 @@ class CombinedRateLimit(RateLimit):
148148
149149
"""
150150

151-
def __init__(self, *parsed_limits: ParsedRateLimit, type: LimitType) -> None:
151+
def __init__(self, *parsed_limits: ParsedRateLimit, type: LimitType) -> None: # noqa: A002
152152
# *parsed_limits is a tuple
153153

154154
# Create a SingleRateLimit instance for each limit

src/pythonxbox/common/request_signer.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,8 @@ def _sign_raw(
146146

147147
@staticmethod
148148
def _hash(data: bytes) -> bytes:
149-
hash = hashlib.sha256()
150-
hash.update(data)
151-
return hash.digest()
149+
"""Compute SHA-256 hash of the input data."""
150+
return hashlib.sha256(data).digest()
152151

153152
@staticmethod
154153
def _concat_data_to_sign( # noqa: PLR0913

0 commit comments

Comments
 (0)