INNER CODE UNIT · Python

find_cpp_files

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

def find_cpp_files() -> List[Path]:
    """Find all C++ source files in the project."""
    project_dir = Path(__file__).parent.parent
    extensions = {".cc", ".cpp", ".cxx"}
    exclude_dirs = {"build", "vcpkg_installed", ".cache", ".git", "third_party"}
    
    files = []
    for ext in extensions:
        for file in project_dir.rglob(f"*{ext}"):
            # Skip files in excluded directories
            # Only directory components are checked for the "build-" prefix so
            # source files like "build-info.cpp" are not skipped.
            if any(part in exclude_dirs for part in file.parts) or any(
                    part.startswith("build-") for part in file.parts[:-1]):
                continue
            files.append(file)
    
    return sorted(files)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…