style: edtlib: Add an explicit strict argument to the zip

Add an explicit strict parameter to the zip
function to fix the Ruff B905 warning.

Signed-off-by: James Roy <rruuaanng@outlook.com>
This commit is contained in:
James Roy 2025-02-17 11:47:03 +08:00 committed by Henrik Brix Andersen
parent 9e46536a1f
commit f2eb205d6d
2 changed files with 4 additions and 5 deletions

View File

@ -443,7 +443,6 @@
]
"./scripts/dts/python-devicetree/src/devicetree/edtlib.py" = [
"B904", # https://docs.astral.sh/ruff/rules/raise-without-from-inside-except
"B905", # https://docs.astral.sh/ruff/rules/zip-without-explicit-strict
"E713", # https://docs.astral.sh/ruff/rules/not-in-test
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
"SIM102", # https://docs.astral.sh/ruff/rules/collapsible-if

View File

@ -1878,7 +1878,7 @@ class Node:
f"{controller._node!r} - {len(cell_names)} "
f"instead of {len(data_list)}")
return dict(zip(cell_names, data_list))
return dict(zip(cell_names, data_list, strict=False))
class EDT:
@ -2840,7 +2840,7 @@ def _add_names(node: dtlib_Node, names_ident: str, objs: Any) -> None:
f"in {node.dt.filename} has {len(names)} strings, "
f"expected {len(objs)} strings")
for obj, name in zip(objs, names):
for obj, name in zip(objs, names, strict=False):
if obj is None:
continue
obj.name = name
@ -3116,7 +3116,7 @@ def _and(b1: bytes, b2: bytes) -> bytes:
# Pad on the left, to equal length
maxlen = max(len(b1), len(b2))
return bytes(x & y for x, y in zip(b1.rjust(maxlen, b'\xff'),
b2.rjust(maxlen, b'\xff')))
b2.rjust(maxlen, b'\xff'), strict=False))
def _or(b1: bytes, b2: bytes) -> bytes:
@ -3126,7 +3126,7 @@ def _or(b1: bytes, b2: bytes) -> bytes:
# Pad on the left, to equal length
maxlen = max(len(b1), len(b2))
return bytes(x | y for x, y in zip(b1.rjust(maxlen, b'\x00'),
b2.rjust(maxlen, b'\x00')))
b2.rjust(maxlen, b'\x00'), strict=False))
def _not(b: bytes) -> bytes: