MCPcopy Create free account
hub / github.com/FonaTech/Clouds-Coder / main

Function main

split_coder.py:2025–2076  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2023
2024
2025def main() -> int:
2026 parser = build_arg_parser()
2027 args = parser.parse_args()
2028
2029 source_path = Path(args.source).expanduser().resolve()
2030 if not source_path.exists():
2031 print(f"Error: Source file not found: {source_path}", file=sys.stderr)
2032 return 1
2033
2034 if args.output_dir:
2035 output_dir = Path(args.output_dir).expanduser().resolve()
2036 else:
2037 output_dir = source_path.parent / "Code_Structure"
2038
2039 if args.self_check and args.dry_run:
2040 print("Error: --self-check cannot be used with --dry-run", file=sys.stderr)
2041 return 2
2042
2043 layout = load_layout(args)
2044
2045 # If auto-layout requested, do a first-pass analysis to generate layout
2046 if layout is None:
2047 print("[AUTO] Running first-pass analysis to generate layout...")
2048 analyzer = ArchitectureAnalyzer(source_path)
2049 nodes = analyzer.analyze()
2050 auto_gen = AutoLayoutGenerator()
2051 layout = auto_gen.generate(nodes)
2052 print(f"[AUTO] Generated layout with {len(layout)} modules")
2053
2054 splitter = Splitter(
2055 source_path=source_path,
2056 output_dir=output_dir,
2057 layout=layout,
2058 dry_run=args.dry_run,
2059 update_mode=args.update,
2060 show_tree=args.show_tree,
2061 dump_layout=args.dump_layout,
2062 report_name=args.report_name,
2063 generate_report=not args.no_report,
2064 )
2065 splitter.run()
2066
2067 if args.self_check:
2068 passed = run_self_check(
2069 source_path,
2070 output_dir,
2071 expect_report=not args.no_report,
2072 report_name=args.report_name,
2073 )
2074 return 0 if passed else 2
2075
2076 return 0
2077
2078
2079if __name__ == "__main__":

Callers 2

split_coder.pyFile · 0.70
__main__.pyFile · 0.50

Calls 9

analyzeMethod · 0.95
generateMethod · 0.95
runMethod · 0.95
build_arg_parserFunction · 0.70
load_layoutFunction · 0.70
AutoLayoutGeneratorClass · 0.70
SplitterClass · 0.70
run_self_checkFunction · 0.70

Tested by

no test coverage detected