@@ -215,30 +215,27 @@ def _export_mermaid_pngs(args, output_dir: Path) -> None:
215215 print (f" - PNG: Skipped (install with: make install-mermaid)" )
216216
217217
218- def _export_calls (args , result , output_dir : Path ):
219- """Export standalone calls.yaml (structured call graph YAML).
220-
221- Generates calls.yaml with structured call graph data:
222- - nodes: functions with metadata (CC, calls_in/out)
223- - edges: caller -> callee relationships
224- - modules: grouping by module
225- - stats: summary statistics
226- """
218+ def _export_calls_format (args , result , output_dir : Path , toon : bool = False ) -> None :
219+ """Shared helper: export call graph in YAML or toon format."""
227220 yaml_exporter = YAMLExporter ()
228- yaml_exporter .export_calls (result , str (output_dir / 'calls.yaml' ))
229- if args .verbose :
230- print (f" - CALLS (call graph YAML): { output_dir / 'calls.yaml' } " )
221+ if toon :
222+ yaml_exporter .export_calls_toon (result , str (output_dir / 'calls.toon.yaml' ))
223+ if args .verbose :
224+ print (f" - CALLS (toon format): { output_dir / 'calls.toon.yaml' } " )
225+ else :
226+ yaml_exporter .export_calls (result , str (output_dir / 'calls.yaml' ))
227+ if args .verbose :
228+ print (f" - CALLS (call graph YAML): { output_dir / 'calls.yaml' } " )
231229
232230
233- def _export_calls_toon (args , result , output_dir : Path ):
234- """Export calls.toon.yaml (call graph in human-readable toon format).
231+ def _export_calls (args , result , output_dir : Path ):
232+ """Export standalone calls.yaml (structured call graph YAML)."""
233+ _export_calls_format (args , result , output_dir , toon = False )
235234
236- Generates calls.toon.yaml with hubs, modules, and edges sections.
237- """
238- yaml_exporter = YAMLExporter ()
239- yaml_exporter .export_calls_toon (result , str (output_dir / 'calls.toon.yaml' ))
240- if args .verbose :
241- print (f" - CALLS (toon format): { output_dir / 'calls.toon.yaml' } " )
235+
236+ def _export_calls_toon (args , result , output_dir : Path ):
237+ """Export calls.toon.yaml (call graph in human-readable toon format)."""
238+ _export_calls_format (args , result , output_dir , toon = True )
242239
243240
244241def _export_mermaid (args , result , output_dir : Path ):
0 commit comments