Skip to content

Commit

Permalink
Boxes + horizonal flow makes for more readable call graphs.
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielVF committed Nov 12, 2024

Verified

This commit was signed with the committer’s verified signature.
gsmet Guillaume Smet
1 parent 3befc96 commit 2aee055
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion slither/printers/call/call_graph.py
Original file line number Diff line number Diff line change
@@ -256,6 +256,8 @@ def output(self, filename: str) -> Output:
}
content = "\n".join(
["strict digraph {"]
+ ["rankdir=\"LR\""]
+ ["node [shape=box]"]
+ [_process_functions(list(all_functions_as_dict.values()))]
+ ["}"]
)
@@ -267,7 +269,11 @@ def output(self, filename: str) -> Output:
with open(derived_output_filename, "w", encoding="utf8") as f:
info += f"Call Graph: {derived_output_filename}\n"
content = "\n".join(
["strict digraph {"] + [_process_functions(derived_contract.functions)] + ["}"]
["strict digraph {"]

Check warning on line 272 in slither/printers/call/call_graph.py

GitHub Actions / Lint Code Base

C0303: Trailing whitespace (trailing-whitespace)
+ ["rankdir=\"LR\""]
+ ["node [shape=box]"]
+ [_process_functions(derived_contract.functions)]

Check warning on line 275 in slither/printers/call/call_graph.py

GitHub Actions / Lint Code Base

C0303: Trailing whitespace (trailing-whitespace)
+ ["}"]
)
f.write(content)
results.append((derived_output_filename, content))

0 comments on commit 2aee055

Please sign in to comment.