Skip to content

Commit 366cc8d

Browse files
jwnrttimothytrippel
authored andcommitted
[python] Apply Ruff auto-fixes
Signed-off-by: James Wainwright <james.wainwright@lowrisc.org> (partially cherry picked from commit 69203fa) Change-Id: I6a409d757e286a2960503c42ad2ee86346b4b35f
1 parent 8b9fc5c commit 366cc8d

File tree

5 files changed

+5
-6
lines changed

5 files changed

+5
-6
lines changed

hw/ip/otbn/dv/otbnsim/sim/stats.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
# SPDX-License-Identifier: Apache-2.0
44

55
from collections import Counter
6-
import typing
76
from typing import Dict, List, Optional, Tuple
87

98
from elftools.dwarf.dwarfinfo import DWARFInfo # type: ignore

util/design/lib/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def check_bool(x):
5656
'''
5757
if isinstance(x, bool):
5858
return x
59-
if not x.lower() in ["true", "false"]:
59+
if x.lower() not in ["true", "false"]:
6060
raise RuntimeError("{} is not a boolean value.".format(x))
6161
else:
6262
return (x.lower() == "true")

util/dvsim/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ def check_bool(x):
631631
"""
632632
if isinstance(x, bool):
633633
return x
634-
if not x.lower() in ["true", "false"]:
634+
if x.lower() not in ["true", "false"]:
635635
raise RuntimeError("{} is not a boolean value.".format(x))
636636
else:
637637
return (x.lower() == "true")

util/reggen/validate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def check_bool(x: Union[bool, str], err_prefix: str) -> Tuple[bool, bool]:
5151
if isinstance(x, bool):
5252
# if Bool returns as it is
5353
return x, False
54-
if not x.lower() in ["true", "false"]:
54+
if x.lower() not in ["true", "false"]:
5555
log.error(err_prefix + ": Bad field value " + x)
5656
return False, True
5757
else:

util/topgen/merge.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ def amend_xbar(top: Dict[str, object],
406406
- size: from top["module"]
407407
"""
408408
xbar_list = [x["name"] for x in top["xbar"]]
409-
if not xbar["name"] in xbar_list:
409+
if xbar["name"] not in xbar_list:
410410
log.info(
411411
"Xbar %s doesn't belong to the top %s. Check if the xbar doesn't need"
412412
% (xbar["name"], top["name"]))
@@ -496,7 +496,7 @@ def xbar_cross_node(node_name, device_xbar, xbars, visited=[]):
496496
devices = host_xbar["connections"][device_xbar["name"]]
497497

498498
for node in host_xbar["nodes"]:
499-
if not node["name"] in devices:
499+
if node["name"] not in devices:
500500
continue
501501
if "xbar" in node and node["xbar"] is True:
502502
if "addr_range" not in node:

0 commit comments

Comments
 (0)