fix: repair 25 Python scripts failing --help across all domains
- Fix Python 3.10+ syntax (float | None → Optional[float]) in 2 scripts - Add argparse CLI handling to 9 marketing scripts using raw sys.argv - Fix 10 scripts crashing at module level (wrap in __main__, add argparse) - Make yaml/prefect/mcp imports conditional with stdlib fallbacks (4 scripts) - Fix f-string backslash syntax in project_bootstrapper.py - Fix -h flag conflict in pr_analyzer.py - Fix tech-debt.md description (score → prioritize) All 237 scripts now pass python3 --help verification. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -455,7 +455,7 @@ def main():
|
||||
help="Base branch for comparison (default: main)"
|
||||
)
|
||||
parser.add_argument(
|
||||
"--head", "-h",
|
||||
"--head",
|
||||
default="HEAD",
|
||||
help="Head branch/commit for comparison (default: HEAD)"
|
||||
)
|
||||
|
||||
@@ -15,7 +15,11 @@ Usage:
|
||||
import os
|
||||
import sys
|
||||
import json
|
||||
import yaml
|
||||
try:
|
||||
import yaml
|
||||
HAS_YAML = True
|
||||
except ImportError:
|
||||
HAS_YAML = False
|
||||
import logging
|
||||
import argparse
|
||||
from pathlib import Path
|
||||
@@ -774,7 +778,10 @@ Examples:
|
||||
# Load config if provided
|
||||
if args.config:
|
||||
with open(args.config) as f:
|
||||
config_data = yaml.safe_load(f)
|
||||
if HAS_YAML:
|
||||
config_data = yaml.safe_load(f)
|
||||
else:
|
||||
config_data = json.load(f)
|
||||
config = PipelineConfig(**config_data)
|
||||
else:
|
||||
# Build config from arguments
|
||||
|
||||
Reference in New Issue
Block a user