From 9207b242ec35440def0dbb28db9a0bf3aa88925b Mon Sep 17 00:00:00 2001 From: Donghyun Kim Date: Tue, 26 May 2026 08:46:57 +0900 Subject: [PATCH] Apply ruff format to MermaidRenderer Bring the new MermaidRenderer in line with the repository's ruff formatting rules (introduced in the develop merge that this branch just absorbed): double-quoted strings, trailing comma after the last mapping entry, four-space hanging indent for the visitor signature, and an additional blank line between top-level classes. --- volatility3/cli/text_renderer.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/volatility3/cli/text_renderer.py b/volatility3/cli/text_renderer.py index 1d5cf3f19..494606861 100644 --- a/volatility3/cli/text_renderer.py +++ b/volatility3/cli/text_renderer.py @@ -624,6 +624,7 @@ class JsonLinesRenderer(JsonRenderer): outfd.write(json.dumps(line, sort_keys=True)) outfd.write("\n") + class MermaidRenderer(CLIRenderer): _type_renderers = { format_hints.Bin: optional(lambda x: f"0b{x:b}"), @@ -633,7 +634,7 @@ class MermaidRenderer(CLIRenderer): interfaces.renderers.Disassembly: optional(display_disassembly), bytes: optional(lambda x: " ".join([f"{b:02x}" for b in x])), datetime.datetime: optional(lambda x: x.strftime("%Y-%m-%d %H:%M:%S.%f %Z")), - 'default': optional(lambda x: f"{x}") + "default": optional(lambda x: f"{x}"), } name = "mermaid" @@ -683,7 +684,7 @@ class MermaidRenderer(CLIRenderer): cells = [] for column_index, column in enumerate(grid.columns): renderer = self._type_renderers.get( - column.type, self._type_renderers['default'] + column.type, self._type_renderers["default"] ) value = renderer(node.values[column_index]) cells.append(f"{column.name}:{self._mermaid_label(value)}") @@ -692,8 +693,8 @@ class MermaidRenderer(CLIRenderer): rows: List[Tuple[int, str]] = [] def visitor( - node: interfaces.renderers.TreeNode, - accumulator: List[Tuple[int, str]], + node: interfaces.renderers.TreeNode, + accumulator: List[Tuple[int, str]], ) -> List[Tuple[int, str]]: accumulator.append((node.path_depth, format_row(node))) return accumulator