Skip to content

Commit 2d9054e

Browse files
committed
Add ruff lint rule - C4
1 parent 4a4d5a8 commit 2d9054e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/smithy-http/src/smithy_http/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def __init__(
2525
kind: FieldPosition = FieldPosition.HEADER,
2626
):
2727
self.name = name
28-
self.values: list[str] = [val for val in values] if values is not None else []
28+
self.values: list[str] = list(values) if values is not None else []
2929
self.kind = kind
3030

3131
def add(self, value: str) -> None:
@@ -99,7 +99,7 @@ def __init__(
9999
:param encoding: The string encoding to be used when converting the ``Field``
100100
name and value from ``str`` to ``bytes`` for transmission.
101101
"""
102-
init_fields = [fld for fld in initial] if initial is not None else []
102+
init_fields = list(initial) if initial is not None else []
103103
init_field_names = [self._normalize_field_name(fld.name) for fld in init_fields]
104104
fname_counter = Counter(init_field_names)
105105
repeated_names_exist = (

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ black = true
4646
target-version = "py312"
4747

4848
[tool.ruff.lint]
49-
# candidates: C4, DTZ, EM, INP, ISC, PERF, PIE, RUF, SIM118, SIM401, SLOT
49+
# candidates: DTZ, EM, INP, ISC, PERF, PIE, RUF, SIM118, SIM401, SLOT
5050
# perhaps in the future: N, PYI, TC, TID
5151
# probably not, a lot of work: DOC, D, PL, TRY
5252

53-
select = [ "ASYNC", "E1", "E4", "E7", "E9", "F", "FURB", "G", "I", "LOG", "S", "T", "UP" ]
53+
select = [ "ASYNC", "C4", "E1", "E4", "E7", "E9", "F", "FURB", "G", "I", "LOG", "S", "T", "UP" ]
5454
exclude = [ "packages/smithy-core/src/smithy_core/rfc3986.py" ]
5555

5656
[tool.ruff.lint.per-file-ignores]

0 commit comments

Comments
 (0)