Linters
What is clang-tidy? An introduction to LLVM Project's linter
clang-tidy is a tool in the Extra Clang Tools collection that provides a large list of named checks. Those checks are organised into groups such as bugprone, abseil, android and clang-analyzer, so you can see at a glance what each one targets.
- Tool
- clang-tidy
- Made by
- LLVM Project
- Official site
- clang.llvm.org/extra/clang-tidy
- Category
- Linters
Who makes clang-tidy
clang-tidy is developed by the LLVM Project, and it is documented as part of the Extra Clang Tools. The official website is linked below, and it is the place to consult for the current list of checks.
Official website: clang.llvm.org/extra/clang-tidy
What clang-tidy is for
clang-tidy is a linter built around a catalogue of named checks. Each check has a name that places it in a group, which makes the catalogue easy to scan and to reason about.
The documentation page for the tool covers an in-progress 24.0.0git version. That means the catalogue is described as it stands in development, so the set of checks you see on the page may differ from what a released build contains.
Who clang-tidy is for
The vendor does not state a target audience. The shape of the catalogue does show where the tool is aimed, though: developers who write code against the Abseil library, who target Android, or who build for Apple platforms will find checks written for their environment.
Developers working with Altera FPGA and OpenCL code are covered as well, as are teams that want a general group of checks for error-prone code patterns.
Notable capabilities
The checks are grouped by theme or platform. These are the groups named in the verified documentation:
- Bugprone checks: a group aimed at error-prone code patterns.
- Abseil checks: checks related to usage of the Abseil library.
- Altera checks: checks for Altera FPGA and OpenCL code.
- Android checks: platform-specific checks, including the cloexec family.
- Clang Static Analyzer checkers: exposed as clang-analyzer-* checks, including security checks for insecure APIs and Unix API misuse.
- Apple platform checks: checks for osx, Cocoa and CoreFoundation code.
How clang-tidy fits linters
Within the category of linters, clang-tidy stands out for how it is organised: one tool, many named checks, grouped by concern. Rather than a single fixed rule set, it offers a catalogue that spans general bug patterns, library-specific usage and platform-specific conventions.
For Linthelm's wider niche of linters, static analysis and code quality, it also shows how the boundaries blur. By exposing the Clang Static Analyzer checkers under the clang-analyzer prefix, it places deeper analysis next to lint-style checks in the same list.
Frequently asked questions
What is clang-tidy used for?
clang-tidy provides a large list of named checks for source code. They are grouped into areas such as bugprone, abseil, android and clang-analyzer.
Who develops clang-tidy?
It is developed by the LLVM Project and documented as part of the Extra Clang Tools.
Does clang-tidy include Android checks?
Yes. Its catalogue includes Android-specific checks, such as the cloexec family.
Does clang-tidy include Clang Static Analyzer checks?
Yes. It exposes Clang Static Analyzer checkers as clang-analyzer-* checks, including security checks for insecure APIs and Unix API misuse.
Does clang-tidy cover Apple platform code?
Yes. It includes checks for Apple platform code, covering osx, Cocoa and CoreFoundation.
Linthelm is independent and is not affiliated with LLVM Project. Product names belong to their owners. Features change; confirm details on the official website.