MCPcopy Create free account
hub / github.com/ClickHouse/ai-sdk-cpp / find_cpp_files

Function find_cpp_files

scripts/format.py:27–41  ·  view source on GitHub ↗

Find all C++ source and header files in the project.

()

Source from the content-addressed store, hash-verified

25
26
27def find_cpp_files() -> List[Path]:
28 """Find all C++ source and header files in the project."""
29 project_dir = Path(__file__).parent.parent
30 extensions = {".h", ".hpp", ".cc", ".cpp", ".cxx"}
31 exclude_dirs = {"build", "vcpkg_installed", ".cache", ".git", "third_party"}
32
33 files = []
34 for ext in extensions:
35 for file in project_dir.rglob(f"*{ext}"):
36 # Skip files in excluded directories
37 # Only directory components are checked for the "build-" prefix so
38 # source files like "build-info.cpp" are not skipped.
39 if any(part in exclude_dirs for part in file.parts) or any(
40 part.startswith("build-") for part in file.parts[:-1]):
41 continue
42 files.append(file)
43
44 return sorted(files)

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected