Skip to content

Commit 9b79584

Browse files
rruuaannghenrikbrixandersen
authored andcommitted
style: edtlib: Remove the redundant keys() method
Remove the redundant keys method when using the in statement on a dict to fix the Ruff SIM118 warning. Signed-off-by: James Roy <[email protected]>
1 parent 8a2cde9 commit 9b79584

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

.ruff-excludes.toml

-1
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,6 @@
439439
"UP007", # https://docs.astral.sh/ruff/rules/non-pep604-annotation
440440
]
441441
"./scripts/dts/python-devicetree/src/devicetree/edtlib.py" = [
442-
"SIM118", # https://docs.astral.sh/ruff/rules/in-dict-keys
443442
"UP007", # https://docs.astral.sh/ruff/rules/non-pep604-annotation
444443
]
445444
"./scripts/dts/python-devicetree/src/devicetree/grutils.py" = [

scripts/dts/python-devicetree/src/devicetree/edtlib.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ def __init__(self, path: Optional[str], fname2path: dict[str, str],
236236

237237
# Initialize look up tables.
238238
self.prop2specs: dict[str, PropertySpec] = {}
239-
for prop_name in self.raw.get("properties", {}).keys():
239+
for prop_name in self.raw.get("properties", {}):
240240
self.prop2specs[prop_name] = PropertySpec(prop_name, self)
241241
self.specifier2cells: dict[str, list[str]] = {}
242242
for key, val in self.raw.items():

0 commit comments

Comments
 (0)