5

Clang-Tidy Linter Framework

This chapter introduces Clang-Tidy, the clang-based linter framework that utilizes the Abstract Syntax Tree (AST) to identify anti-patterns in C/C++/Objective-C code. First, we’ll discuss Clang-Tidy’s capabilities, the types of checks it offers, and how to use them. After that, we will delve into the architecture of Clang-Tidy and explore how to create our own custom lint check. In this chapter, we’ll cover the following topics:

  • An overview of Clang-Tidy, including a brief description of the different checks provided by default

  • The internal design of Clang-Tidy

  • How to create a custom Clang-Tidy check

5.1 Technical requirements

The source code for this chapter is located in the chapter5 folder of the book’s ...

Get Clang Compiler Frontend now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.