Skip to content

Commit

Permalink
Merge pull request #851 from bartsanchez/bart/fix-ruff-rule-PLR1704
Browse files Browse the repository at this point in the history
fix: Ruff rule PLR1704 (redefined-argument-from-local)
  • Loading branch information
boriel authored Nov 4, 2024
2 parents b82be81 + 1e390af commit de6f41f
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 7 deletions.
21 changes: 20 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,31 @@ line-length = 120
target-version = "py310"

[tool.ruff.lint]
select = ["E", "F", "I", "C4", "UP", "RUF"]
select = [
"C4",
"E",
"F",
"I",
"PLR",
"RUF",
"UP",
]
ignore = [
"E713",
"E722",
"E731",
"E741",
"PLR0124",
"PLR0402",
"PLR0911",
"PLR0912",
"PLR0913",
"PLR0915",
"PLR1714",
"PLR1722",
"PLR1730",
"PLR2004",
"PLR5501",
"RUF005",
"RUF012",
"RUF013",
Expand Down
6 changes: 3 additions & 3 deletions src/api/symboltable/symboltable.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ def get_entry(self, id_: str, scope: Scope | None = None) -> symbols.ID | None:
if scope is not None:
return scope[id_]

for scope in self:
if scope[id_] is not None:
return scope[id_]
for s in self:
if s[id_] is not None:
return s[id_]

return None # Not found

Expand Down
6 changes: 3 additions & 3 deletions src/arch/z80/backend/_f16.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,9 @@ def f16_to_32bit(cls, ins: Quad) -> Quad:
as they are.
"""
quads = list(ins)
for i, ins in enumerate(quads[1:], 1):
if is_float(ins):
de, hl = cls.f16(ins)
for i, instruction in enumerate(quads[1:], 1):
if is_float(instruction):
de, hl = cls.f16(instruction)
quads[i] = str((de << 16) | hl)

ins = Quad(*quads)
Expand Down

0 comments on commit de6f41f

Please sign in to comment.