codemap generation
Some checks failed
Some checks failed
This commit is contained in:
@@ -1302,6 +1302,49 @@ async def run_validate_async(
|
||||
)
|
||||
|
||||
|
||||
def run_codemap(
|
||||
project_root: Path, silent: bool = False, yaml_output: bool = False
|
||||
) -> Tuple[bool, Dict]:
|
||||
"""Generate code map - JSON format only"""
|
||||
if not silent and not yaml_output:
|
||||
print_header("🗺️ Code Map Generator")
|
||||
|
||||
try:
|
||||
result = run_command(
|
||||
["python", "tools/generate_code_map.py"],
|
||||
project_root,
|
||||
timeout=120,
|
||||
)
|
||||
|
||||
success = result.returncode == 0
|
||||
|
||||
if not yaml_output:
|
||||
if success:
|
||||
if not silent:
|
||||
print(result.stdout)
|
||||
msg = "✅ Code maps generated in .llm/ directory"
|
||||
colored_msg = Colors.colorize(msg, Colors.GREEN + Colors.BOLD)
|
||||
print(colored_msg)
|
||||
else:
|
||||
msg = "❌ Code map generation failed"
|
||||
colored_msg = Colors.colorize(msg, Colors.RED + Colors.BOLD)
|
||||
print(colored_msg)
|
||||
if result.stderr:
|
||||
print(Colors.colorize(result.stderr, Colors.RED))
|
||||
|
||||
stats = {"Success": success}
|
||||
|
||||
if yaml_output:
|
||||
output_yaml_results("codemap", stats, success)
|
||||
|
||||
return success, stats
|
||||
|
||||
except Exception as e:
|
||||
if not silent and not yaml_output:
|
||||
print(f"❌ ERROR: {e}")
|
||||
return False, {}
|
||||
|
||||
|
||||
def run_naming(
|
||||
project_root: Path, silent: bool = False, yaml_output: bool = False
|
||||
) -> Tuple[bool, Dict]:
|
||||
@@ -1905,6 +1948,10 @@ def run_workflow(
|
||||
"📝 Naming convention check (PascalCase)",
|
||||
lambda root: run_naming(root, silent, yaml_output),
|
||||
),
|
||||
"codemap": (
|
||||
"🗺️ Code map generation (yaml)",
|
||||
lambda root: run_codemap(root, silent, yaml_output),
|
||||
),
|
||||
}
|
||||
|
||||
if not silent:
|
||||
@@ -2060,6 +2107,12 @@ async def run_workflow_async(
|
||||
root, silent, yaml_output
|
||||
), # Using sync version - lightweight
|
||||
),
|
||||
"codemap": (
|
||||
"🗺️ Code map generation (yaml)",
|
||||
lambda root: run_codemap(
|
||||
root, silent, yaml_output
|
||||
), # Using sync version - subprocess call
|
||||
),
|
||||
}
|
||||
|
||||
if not silent:
|
||||
@@ -2174,7 +2227,7 @@ async def main_async():
|
||||
parser.add_argument(
|
||||
"--steps",
|
||||
nargs="+",
|
||||
choices=["lint", "format", "test", "validate", "ruff", "naming"],
|
||||
choices=["lint", "format", "test", "validate", "ruff", "naming", "codemap"],
|
||||
default=["format", "lint", "ruff", "test", "validate", "naming"],
|
||||
help="Workflow steps to run",
|
||||
)
|
||||
@@ -2190,6 +2243,7 @@ async def main_async():
|
||||
parser.add_argument(
|
||||
"--naming", action="store_true", help="Check PascalCase naming conventions"
|
||||
)
|
||||
parser.add_argument("--codemap", action="store_true", help="Generate code map YAML")
|
||||
parser.add_argument(
|
||||
"--silent",
|
||||
"-s",
|
||||
@@ -2221,6 +2275,10 @@ async def main_async():
|
||||
steps = ["validate"]
|
||||
elif args.ruff:
|
||||
steps = ["ruff"]
|
||||
elif args.naming:
|
||||
steps = ["naming"]
|
||||
elif args.codemap:
|
||||
steps = ["codemap"]
|
||||
else:
|
||||
steps = args.steps
|
||||
|
||||
@@ -2239,6 +2297,7 @@ async def main_async():
|
||||
),
|
||||
"ruff": lambda root: run_ruff_async(root, args.silent, args.yaml),
|
||||
"naming": lambda root: run_naming(root, args.silent, args.yaml),
|
||||
"codemap": lambda root: run_codemap(root, args.silent, args.yaml),
|
||||
}
|
||||
success, _ = await step_funcs[steps[0]](project_root)
|
||||
else:
|
||||
@@ -2249,6 +2308,7 @@ async def main_async():
|
||||
"validate": lambda root: run_validate(root, args.silent, args.yaml),
|
||||
"ruff": lambda root: run_ruff(root, args.silent, args.yaml),
|
||||
"naming": lambda root: run_naming(root, args.silent, args.yaml),
|
||||
"codemap": lambda root: run_codemap(root, args.silent, args.yaml),
|
||||
}
|
||||
success, _ = step_funcs[steps[0]](project_root)
|
||||
else:
|
||||
@@ -2296,6 +2356,9 @@ def main():
|
||||
parser.add_argument(
|
||||
"--naming", action="store_true", help="Check PascalCase naming conventions"
|
||||
)
|
||||
parser.add_argument(
|
||||
"--codemap", action="store_true", help="Generate code map YAML"
|
||||
)
|
||||
parser.add_argument(
|
||||
"--silent",
|
||||
"-s",
|
||||
@@ -2327,6 +2390,10 @@ def main():
|
||||
steps = ["validate"]
|
||||
elif args.ruff:
|
||||
steps = ["ruff"]
|
||||
elif args.naming:
|
||||
steps = ["naming"]
|
||||
elif args.codemap:
|
||||
steps = ["codemap"]
|
||||
else:
|
||||
steps = args.steps
|
||||
|
||||
@@ -2339,6 +2406,7 @@ def main():
|
||||
"validate": lambda root: run_validate(root, args.silent, args.yaml),
|
||||
"ruff": lambda root: run_ruff(root, args.silent, args.yaml),
|
||||
"naming": lambda root: run_naming(root, args.silent, args.yaml),
|
||||
"codemap": lambda root: run_codemap(root, args.silent, args.yaml),
|
||||
}
|
||||
success, _ = step_funcs[steps[0]](project_root)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user