diff options
| author | Wander Lairson Costa <wander@redhat.com> | 2026-02-23 13:17:51 -0300 |
|---|---|---|
| committer | Gabriele Monaco <gmonaco@redhat.com> | 2026-04-01 10:16:18 +0200 |
| commit | 0d5c9f1091350328d903f4aed5de31f493a2f55b (patch) | |
| tree | 4034a19d77c52e95bc626fe7e07b22aadcb907d9 | |
| parent | 76ad28af8e6b23e39bf7e1342887533db4271ae9 (diff) | |
rv/rvgen: fix PEP 8 whitespace violations
Fix whitespace violations throughout the rvgen codebase to comply
with PEP 8 style guidelines. The changes address missing whitespace
after commas, around operators, and in collection literals that
were flagged by pycodestyle.
The fixes include adding whitespace after commas in string replace
chains and function arguments, adding whitespace around arithmetic
operators, removing extra whitespace in list comprehensions, and
fixing dictionary literal spacing. These changes improve code
readability and consistency with Python coding standards.
Signed-off-by: Wander Lairson Costa <wander@redhat.com>
Reviewed-by: Gabriele Monaco <gmonaco@redhat.com>
Reviewed-by: Nam Cao <namcao@linutronix.de>
Link: https://lore.kernel.org/r/20260223162407.147003-9-wander@redhat.com
Signed-off-by: Gabriele Monaco <gmonaco@redhat.com>
| -rw-r--r-- | tools/verification/rvgen/rvgen/automata.py | 8 | ||||
| -rw-r--r-- | tools/verification/rvgen/rvgen/dot2c.py | 2 | ||||
| -rw-r--r-- | tools/verification/rvgen/rvgen/dot2k.py | 4 | ||||
| -rw-r--r-- | tools/verification/rvgen/rvgen/generator.py | 2 |
4 files changed, 8 insertions, 8 deletions
diff --git a/tools/verification/rvgen/rvgen/automata.py b/tools/verification/rvgen/rvgen/automata.py index 60792aaebf12..397f236e6eea 100644 --- a/tools/verification/rvgen/rvgen/automata.py +++ b/tools/verification/rvgen/rvgen/automata.py @@ -135,7 +135,7 @@ class Automata: raw_state = line[-1] # "enabled_fired"}; -> enabled_fired - state = raw_state.replace('"', '').replace('};', '').replace(',','_') + state = raw_state.replace('"', '').replace('};', '').replace(',', '_') if state[0:7] == "__init_": initial_state = state[7:] else: @@ -264,7 +264,7 @@ class Automata: nr_state += 1 # declare the matrix.... - matrix = [[ self.invalid_state_str for x in range(nr_event)] for y in range(nr_state)] + matrix = [[self.invalid_state_str for x in range(nr_event)] for y in range(nr_state)] constraints: dict[_ConstraintKey, list[str]] = {} # and we are back! Let's fill the matrix @@ -273,8 +273,8 @@ class Automata: while self.__dot_lines[cursor].lstrip()[0] == '"': if self.__dot_lines[cursor].split()[1] == "->": line = self.__dot_lines[cursor].split() - origin_state = line[0].replace('"','').replace(',','_') - dest_state = line[2].replace('"','').replace(',','_') + origin_state = line[0].replace('"', '').replace(',', '_') + dest_state = line[2].replace('"', '').replace(',', '_') possible_events = "".join(line[line.index("label") + 2:-1]).replace('"', '') for event in possible_events.split("\\n"): event, *constr = event.split(";") diff --git a/tools/verification/rvgen/rvgen/dot2c.py b/tools/verification/rvgen/rvgen/dot2c.py index 9255cc2153a3..fc85ba1f649e 100644 --- a/tools/verification/rvgen/rvgen/dot2c.py +++ b/tools/verification/rvgen/rvgen/dot2c.py @@ -182,7 +182,7 @@ class Dot2c(Automata): line += f"\t\t\t{next_state}" else: line += f"{next_state:>{maxlen}}" - if y != nr_events-1: + if y != nr_events - 1: line += ",\n" if linetoolong else ", " else: line += ",\n\t\t}," if linetoolong else " }," diff --git a/tools/verification/rvgen/rvgen/dot2k.py b/tools/verification/rvgen/rvgen/dot2k.py index aedc2a7799b3..e6f476b903b0 100644 --- a/tools/verification/rvgen/rvgen/dot2k.py +++ b/tools/verification/rvgen/rvgen/dot2k.py @@ -134,8 +134,8 @@ class dot2k(Monitor, Dot2c): tp_args = tp_args_dict[tp_type] if self._is_id_monitor(): tp_args.insert(0, tp_args_id) - tp_proto_c = ", ".join([a+b for a,b in tp_args]) - tp_args_c = ", ".join([b for a,b in tp_args]) + tp_proto_c = ", ".join([a + b for a, b in tp_args]) + tp_args_c = ", ".join([b for a, b in tp_args]) buff.append(f" TP_PROTO({tp_proto_c}),") buff.append(f" TP_ARGS({tp_args_c})") return '\n'.join(buff) diff --git a/tools/verification/rvgen/rvgen/generator.py b/tools/verification/rvgen/rvgen/generator.py index 988ccdc27fa3..40d82afb018f 100644 --- a/tools/verification/rvgen/rvgen/generator.py +++ b/tools/verification/rvgen/rvgen/generator.py @@ -228,7 +228,7 @@ obj-$(CONFIG_RV_MON_{name_up}) += monitors/{name}/{name}.o class Monitor(RVGenerator): - monitor_types = { "global" : 1, "per_cpu" : 2, "per_task" : 3, "per_obj" : 4 } + monitor_types = {"global": 1, "per_cpu": 2, "per_task": 3, "per_obj": 4} def __init__(self, extra_params={}): super().__init__(extra_params) |
