INNER CODE UNIT · Python

main

ClickHouse/ai-sdk-cpp · scripts/lint.py:178

def main(fix: bool, jobs: int):
    """Run clang-tidy on all C++ source files in parallel."""
    # Check if clang-tidy is installed
    if not shutil.which("clang-tidy"):
        console.print("[red]Error: clang-tidy is not installed.[/red]")
        console.print("Install it with: brew install llvm (macOS) or apt-get install clang-tidy (Ubuntu)")
        sys.exit(1)
    
    # Find compile_commands.json
    compile_commands = find_compile_commands()
    if not compile_commands:
        console.print("[red]Error: compile_commands.json not found.[/red]")
        console.print("Please build the project first with:")
        console.print("  cmake -B build -DCMAKE_EXPORT_COMPILE_COMMANDS=ON")
        console.print("  cmake --build build")
        sys.exit(1)
    
    console.print(f"[blue]Using compile commands: {compile_commands}[/blue]")

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…