Skip to content
SPECIFICTION
Get listed

clang-tidy

clang.llvm.org

Free plan Linux
Visit clang.llvm.org
Spec score 8.5 #4 of 33 in Linters

Spec sheet

Purpose
clang-tidy is a Clang-based C++ linter for diagnosing and fixing typical programming errors, including style violations, interface misuse, and bugs detectable by static analysis.Read 11 Oct 2026 · clang.llvm.org
License
The LLVM project states that its code is licensed under the Apache 2.0 License with LLVM exceptions.Read 11 Oct 2026 · llvm.org
Maker
LLVM describes itself as a collection of modular and reusable compiler and toolchain technologies, and identifies clang-tidy as an LLVM project tool.Read 11 Oct 2026 · llvm.org
Automatic fixes
The -fix option applies suggested fixes when supported by the corresponding checks.Read 11 Oct 2026 · clang.llvm.org
Build integration
clang-tidy can use a compile command database, which CMake can generate with CMAKE_EXPORT_COMPILE_COMMANDS=ON.Read 11 Oct 2026 · clang.llvm.org
Build options
If built with `CLANG_TIDY_ENABLE_STATIC_ANALYZER=NO`, clang-tidy does not include support for `clang-analyzer-*` or `mpi-*` checks.Read 11 Oct 2026 · clang.llvm.org
Changed-line analysis
`clang-tidy-diff.py` filters reported diagnostics to changed lines, but still analyzes the entire file and does not improve analysis performance.Read 11 Oct 2026 · clang.llvm.org
Check categories
Its check groups include bug-prone code, CERT guidelines, C++ Core Guidelines, performance, portability, and readability checks.Read 11 Oct 2026 · clang.llvm.org
Check selection
Checks can be selected with the `-checks=` option, which accepts comma-separated positive and negative globs.Read 11 Oct 2026 · clang.llvm.org
Checks
It provides its own checks and can also run Clang Static Analyzer checks.Read 11 Oct 2026 · clang.llvm.org
clangd support
The Clang team recommends clangd, which integrates clang-tidy and is available in major editors through plugins including Vim, Emacs, Visual Studio Code, and Sublime Text.Read 11 Oct 2026 · clang.llvm.org
Configuration
Checks can be selected with comma-separated positive and negative globs, and configuration can be read from a .clang-tidy file.Read 11 Oct 2026 · clang.llvm.org
CUDA support
clang-tidy supports CUDA source analysis, with the CUDA toolkit path specified using --cuda-path for correct header resolution.Read 11 Oct 2026 · clang.llvm.org
Custom checks
The tool provides an interface for writing custom checks, which can use preprocessor callbacks or AST matchers and attach fix-it hints to diagnostics.Read 11 Oct 2026 · clang.llvm.org
Diff workflow
clang-tidy-diff.py filters diagnostics to changed lines, but still analyzes the entire file and may miss issues reported outside those lines.Read 11 Oct 2026 · clang.llvm.org
Extensible checks
The tool is modular and provides a framework for writing new checks.Read 11 Oct 2026 · clang.llvm.org
IDE integrations
The documentation lists integrations including clangd, CLion, KDevelop, Qt Creator, Visual Studio tools, Vim plugins, and Emacs Flycheck.Read 11 Oct 2026 · clang.llvm.org
IDE/editor integrations
The documentation links to a Clang-tidy IDE/Editor Integrations page.Read 11 Oct 2026 · clang.llvm.org
Parallel analysis
The included `run-clang-tidy.py` script runs analysis over files in a compilation database concurrently.Read 11 Oct 2026 · clang.llvm.org
Parallel runs
The included run-clang-tidy.py script runs analysis concurrently across files in a compilation database or specified path.Read 11 Oct 2026 · clang.llvm.org
Project setup
clang-tidy is based on LibTooling and works with a compilation database such as `compile_commands.json`; compiler options can also be supplied on the command line.Read 11 Oct 2026 · clang.llvm.org
Security checks
The documented check groups include CERT secure coding checks and Clang Static Analyzer checks, among other categories.Read 11 Oct 2026 · clang.llvm.org
Static analysis
clang-tidy includes its own checks and can also run Clang Static Analyzer checks.Read 11 Oct 2026 · clang.llvm.org

Plans and prices

clang-tidy Free No paid plans or usage limits stated Read 11 Oct 2026 · clang.llvm.org

Every clang-tidy plan and price →

Where Specifiction places it

Alternatives to clang-tidyAll alternatives →