clangd-tidy
raw JSON → 1.1.1 verified Sat May 09 auth: no python
A faster alternative to clang-tidy that uses clangd to provide linting and formatting checks. Current version is 1.1.1, with an active release cadence. Requires Python >=3.8.
pip install clangd-tidy Common errors
error ModuleNotFoundError: No module named 'clangd_tidy' ↓
cause Missing pip install or wrong import path.
fix
Run
pip install clangd-tidy and use from clangd_tidy import .... error clangd: command not found ↓
cause clangd executable not installed or not in PATH.
fix
Install clangd (e.g.,
apt install clangd on Debian/Ubuntu, brew install llvm on macOS). error ValueError: URI path is not absolute ↓
cause On Windows, clangd-tidy <1.1.1 cannot parse file URIs with drive letters.
fix
Upgrade to clangd-tidy >=1.1.1.
Warnings
gotcha clangd-tidy requires clangd to be installed and in PATH. Without clangd, the tool will fail silently or produce no results. ↓
fix Install clangd via your package manager (e.g., apt install clangd, brew install llvm).
breaking In v1.1.0, the internal LSP client was rewritten, removing pylspclient. This may break code depending on internal client behavior. ↓
fix If you rely on pylspclient, pin to <1.1.0 or adapt to the async interface.
gotcha Windows file URI handling was fixed in v1.1.1 for file paths with drive letters. Prior versions may fail to process Windows paths. ↓
fix Upgrade to v1.1.1 or manually convert file URIs to absolute paths.
Imports
- ClangdTidyRunner
from clangd_tidy import ClangdTidyRunner
Quickstart
from clangd_tidy import ClangdTidyRunner
runner = ClangdTidyRunner()
results = runner.run(['example.cpp'])
for r in results:
print(r.message)