devops.cpp.ast.engine

Shared single-pass AST-walk engine for libclang-based C++ checks.

Functions

run_ast_checks(path, content, compile_args)

Parse path once and run every given AST check over it.

devops.cpp.ast.engine.run_ast_checks(path, content, compile_args, checks=None)[source]

Parse path once and run every given AST check over it.

Parameters:
  • path (Path) – Path of the file being checked (used for diagnostics and parsing).

  • content (str) – The file’s current content, passed to libclang as an unsaved file so checks see exactly what devops already read from disk (or staged), instead of re-reading it.

  • compile_args (list[str]) – Compiler flags (e.g. -std=c++23, include paths) passed to libclang when parsing.

  • checks (list[Check] | None) – The checks to run. Defaults to ALL_CHECKS (every registered check) when omitted — pass a filtered subset (see devops.cpp.ast.registry.select_checks) to run only some of them.

Returns:

list[Diagnostic] – All diagnostics raised by any of checks, sorted by location.

Return type:

list[Diagnostic]