Resolve project root, graphify output dir, and optional files.
(args)
| 427 | |
| 428 | |
| 429 | def resolve_graphify_paths(args) -> dict: |
| 430 | """Resolve project root, graphify output dir, and optional files.""" |
| 431 | base = Path(args.project).expanduser() if args.project else Path.cwd() |
| 432 | if args.graphify_out: |
| 433 | graphify_out = Path(args.graphify_out).expanduser() |
| 434 | elif args.graph: |
| 435 | graphify_out = Path(args.graph).expanduser().parent |
| 436 | elif (base / "graph.json").exists(): |
| 437 | graphify_out = base |
| 438 | else: |
| 439 | graphify_out = base / GRAPHIFY_OUT |
| 440 | |
| 441 | project_root = graphify_out.parent if graphify_out.name == GRAPHIFY_OUT_NAME else base |
| 442 | graph = Path(args.graph).expanduser() if args.graph else graphify_out / "graph.json" |
| 443 | report = Path(args.report).expanduser() if args.report else graphify_out / "GRAPH_REPORT.md" |
| 444 | labels = Path(args.labels).expanduser() if args.labels else graphify_out / ".graphify_labels.json" |
| 445 | sections = Path(args.sections).expanduser() if args.sections else None |
| 446 | return { |
| 447 | "base": project_root, |
| 448 | "graphify_out": graphify_out, |
| 449 | "graph": graph, |
| 450 | "report": report, |
| 451 | "labels": labels, |
| 452 | "sections": sections, |
| 453 | } |
| 454 | |
| 455 | |
| 456 | def is_zh(lang: str) -> bool: |
no outgoing calls
no test coverage detected