fix: resolve CI/CD issues - remove unused imports and fix type mismatches
This commit is contained in:
@@ -76,16 +76,16 @@ def analyze(
|
|||||||
console.print(f"Graph contains {len(nodes)} nodes")
|
console.print(f"Graph contains {len(nodes)} nodes")
|
||||||
|
|
||||||
if format == "dot":
|
if format == "dot":
|
||||||
exporter = DOTExporter(graph_builder)
|
dot_exporter = DOTExporter(graph_builder)
|
||||||
content = exporter.get_string()
|
content = dot_exporter.get_string()
|
||||||
if output:
|
if output:
|
||||||
Path(output).write_text(content)
|
Path(output).write_text(content)
|
||||||
console.print(f"Exported DOT to: {output}")
|
console.print(f"Exported DOT to: {output}")
|
||||||
else:
|
else:
|
||||||
console.print(content)
|
console.print(content)
|
||||||
elif format == "json":
|
elif format == "json":
|
||||||
exporter = JSONExporter(graph_builder)
|
json_exporter = JSONExporter(graph_builder)
|
||||||
content = exporter.get_string()
|
content = json_exporter.get_string()
|
||||||
if output:
|
if output:
|
||||||
Path(output).write_text(content)
|
Path(output).write_text(content)
|
||||||
console.print(f"Exported JSON to: {output}")
|
console.print(f"Exported JSON to: {output}")
|
||||||
@@ -93,8 +93,8 @@ def analyze(
|
|||||||
console.print(content)
|
console.print(content)
|
||||||
elif format == "png":
|
elif format == "png":
|
||||||
if output:
|
if output:
|
||||||
exporter = PNGExporter(graph_builder)
|
png_exporter = PNGExporter(graph_builder)
|
||||||
exporter.export(Path(output))
|
png_exporter.export(Path(output))
|
||||||
console.print(f"Exported PNG to: {output}")
|
console.print(f"Exported PNG to: {output}")
|
||||||
else:
|
else:
|
||||||
console.print("[red]Error: PNG format requires output file path[/red]")
|
console.print("[red]Error: PNG format requires output file path[/red]")
|
||||||
@@ -247,14 +247,14 @@ def export(ctx: click.Context, path: str, language: str, output: str):
|
|||||||
graph_builder.build_from_parser_results(results)
|
graph_builder.build_from_parser_results(results)
|
||||||
|
|
||||||
if output_path.suffix == ".dot":
|
if output_path.suffix == ".dot":
|
||||||
exporter = DOTExporter(graph_builder)
|
dot_exporter = DOTExporter(graph_builder)
|
||||||
exporter.export(output_path)
|
dot_exporter.export(output_path)
|
||||||
elif output_path.suffix == ".json":
|
elif output_path.suffix == ".json":
|
||||||
exporter = JSONExporter(graph_builder)
|
json_exporter = JSONExporter(graph_builder)
|
||||||
exporter.export(output_path)
|
json_exporter.export(output_path)
|
||||||
elif output_path.suffix in [".png", ".svg"]:
|
elif output_path.suffix in [".png", ".svg"]:
|
||||||
exporter = PNGExporter(graph_builder)
|
png_exporter = PNGExporter(graph_builder)
|
||||||
exporter.export(output_path, format=output_path.suffix[1:])
|
png_exporter.export(output_path, format=output_path.suffix[1:])
|
||||||
else:
|
else:
|
||||||
console.print(f"[red]Unsupported output format: {output_path.suffix}[/red]")
|
console.print(f"[red]Unsupported output format: {output_path.suffix}[/red]")
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user