INNER CODE UNIT · Python
find_cpp_files
ClickHouse/ai-sdk-cpp · scripts/format.py:27
def find_cpp_files() -> List[Path]:
"""Find all C++ source and header files in the project."""
project_dir = Path(__file__).parent.parent
extensions = {".h", ".hpp", ".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)