INNER CODE UNIT · Python

main

ClickHouse/ai-sdk-cpp · scripts/format.py:67

def main(check: bool):
    """Format all C++ source files using clang-format."""
    # Check if clang-format is installed
    if not shutil.which("clang-format"):
        console.print("[red]Error: clang-format is not installed.[/red]")
        console.print("Install it with: brew install clang-format (macOS) or apt-get install clang-format (Ubuntu)")
        sys.exit(1)
    
    # Find all C++ files
    files = find_cpp_files()
    
    if not files:
        console.print("[yellow]No C++ files found[/yellow]")
        return
    
    if check:
        console.print(f"[blue]Checking code formatting for {len(files)} files...[/blue]\n")
        

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…