I use clang-tidy with run-clang-tidy.py, and run it from CI so that pull requests are verified: https://github.com/Sarcasm/irony-mode/blob/82ba45ec15c9011bbdf1d69cf25c8193d33c0028/server/.clang-tidy I run it on Travis CI, see configuration here: https://github.com/Sarcasm/irony-mode/blob/82ba45ec15c9011bbdf1d69cf25c8193d33c0028/.travis.yml#L49-L54 For the PR to get validated, I treat warnings as errors: https://github.com/Sarcasm/irony-mode/tree/82ba45ec15c9011bbdf1d69cf25c8193d33c0028/server/build-aux/run-clang-tidy I have a similar setup for clang-format: https://github.com/Sarcasm/run-clang-format I also have some notes about clang-tidy, which I will update soon now that I have started using it at work: https://sarcasm.github.io/notes/dev/clang-tidy.html Answer from beautiful_tango on reddit.com
🌐
Clang
clang.llvm.org › extra › clang-tidy
Clang-Tidy — Extra Clang Tools 23.0.0git documentation
For example: [ {"name":"file1.cpp","lines":[[1,3],[5,7]]}, {"name":"file2.h"} ] This will output diagnostics from 'file1.cpp' only for the line ranges [1,3] and [5,7], as well as all from the entire 'file2.h'. --list-checks - List all enabled checks and exit. Use with -checks=* to list all available checks. --load=<pluginfilename> - Load the specified plugin -p <string> - Build path --quiet - Run clang-tidy in quiet mode.
Discussions

How to use .clang-tidy config file?
Hi, I would like to use .clang-tidy files instead of declaring all of my needs in the --config= switch (is this switch even supported? From what I can read in the docs (Redirecting...) it is not.) Is there any way to accomplish this? More on community.platformio.org
🌐 community.platformio.org
0
0
February 18, 2022
c++ - How to use and configure clang-tidy on windows? - Stack Overflow
I'm trying to use clang-tidy code analysis so I can check for CppCoreGuidelines. I downloaded LLVM 7.0.0 pre-built binary for Win 7 64 bits. I'm able to successfully compile with clang, I did a basic More on stackoverflow.com
🌐 stackoverflow.com
How to use Clang tidy in CMake - Stack Overflow
I would like to use CMake and clang-tidy in my project. However, I see that build times are quite a bit higher when I use this in all the main CMake file: set(CMAKE_CXX_CLANG_TIDY clang-tidy-11; - More on stackoverflow.com
🌐 stackoverflow.com
How to activate clang-tidy checks
Unfortunately, after compiling, there is no warning or error telling me this. This is my .clang-tidy file Checks: '*' CheckOptions: - key: modernize-use-nullptr.NullMacros value: NULL,CUSTOM_NULL I really don’t know how to activate clang-tidy. As I understand it, I... More on forums.mbed.com
🌐 forums.mbed.com
1
0
January 12, 2022
People also ask

How do I enable clang-tidy in Visual Studio?
You can enable clang-tidy in Visual Studio 2019 or later through the Code Analysis settings. It works best with the LLVM toolset but can also be configured with MSVC. Once enabled, results appear in the Error List during analysis.
🌐
wholetomato.com
wholetomato.com › home › tips and tricks › a brief introduction to clang-tidy and its role in visual assist
A Brief Introduction To Clang-Tidy And Its Role in Visual Assist ...
What is the difference between clang-tidy and compiler warnings?
Compiler warnings focus on issues that affect compilation, while clang-tidy performs deeper static analysis. It detects code smells, style violations, and modernization opportunities. This makes it more useful for improving code quality over time.
🌐
wholetomato.com
wholetomato.com › home › tips and tricks › a brief introduction to clang-tidy and its role in visual assist
A Brief Introduction To Clang-Tidy And Its Role in Visual Assist ...
How can I ignore specific clang-tidy warnings?
You can disable warnings using a .clang-tidy configuration file or inline comments like // NOLINT. This allows you to control which checks are applied globally or on specific lines. It helps reduce unnecessary noise in results.
🌐
wholetomato.com
wholetomato.com › home › tips and tricks › a brief introduction to clang-tidy and its role in visual assist
A Brief Introduction To Clang-Tidy And Its Role in Visual Assist ...
🌐
KDAB
kdab.com › clang-tidy-part-1-modernize-source-code-using-c11c14
Clang-Tidy, part 1: Modernize your source code using C++11/C++14 | KDAB
January 22, 2025 - This blog series will introduce the clang-tidy utility from the Clang/LLVM project and show how to use it to automatically refactor C++ source code and integrate with your build system, as well as how to use the tool on other platforms than Unices.
🌐
Microsoft Learn
learn.microsoft.com › en-us › cpp › code-quality › clang-tidy
Using Clang-Tidy in Visual Studio | Microsoft Learn
In the project Property Pages dialog, open the Configuration Properties > Code Analysis > Clang-Tidy page. Manually type in the path or Browse and select the path under the Clang-Tidy Tool Directory property.
🌐
LaBRI
labri.fr › perso › fleury › posts › programming › using-clang-tidy-and-clang-format.html
Using clang-tidy and clang-format
April 23, 2016 - So, we just have to write this in .clang-tidy in our project root directory and, now, we just have to run part of the previous command with the option -config='' to get the content of the .clang-tidy file as default configuration file: $> clang-tidy Example.[ch]pp -config='' -- -std=c++11 ...
Find elsewhere
🌐
Visual Assist
wholetomato.com › home › tips and tricks › a brief introduction to clang-tidy and its role in visual assist
A Brief Introduction To Clang-Tidy And Its Role in Visual Assist - Tomato Soup
January 8, 2021 - A lot of checks have “auto-fixes”! By providing the -fix command, you can ask the tool to modify the code. For example: clang-tidy --checks='modernize-* readability-container*' -fix hello_tidy.cpp -- -std=c++14 · As you can see, this time I used “readability-container” only as I didn’t want to modify braces around simple if statements.
🌐
PlatformIO Community
community.platformio.org › advanced solutions › static code analysis
How to use .clang-tidy config file? - Static Code Analysis - PlatformIO Community
February 18, 2022 - Hi, I would like to use .clang-tidy files instead of declaring all of my needs in the --config= switch (is this switch even supported? From what I can read in the docs (Redirecting...) it is not.) Is there any way to a…
🌐
Red Hat
developers.redhat.com › blog › 2021 › 04 › 06 › get-started-with-clang-tidy-in-red-hat-enterprise-linux
Code analysis with clang-tidy in Red Hat Enterprise Linux | Red Hat Developer
October 7, 2022 - However, because it only takes source files as input, you can use clang-tidy for any C or C++ codebase no matter what compiler you are using. This article is a quick introduction to code analysis with clang-tidy, including how to check for rule violations in a simple C-based program and how to integrate clang-tidy with your build system.
🌐
Ortogonal
ortogonal.github.io › cmake-clang-tidy
Integrate Clang-Tidy into CMake – Embedded bits and pixels
February 6, 2019 - Now we set which we would like to treat as errors. If we set -warnings-as-errors=* both of the two tests above will generate errors. If you set warnings-as-errors=cppcoreguidelines-avoid-goto only the test cppcoreguidelines-avoid-goto will be treated as an error. Remember that by setting -warnings-as-errors=...you don’t enable any test, this must be done by using -checks=. Below is a example how -warnings-as-errors looks in CMake. set(CMAKE_CXX_CLANG_TIDY clang-tidy; -header-filter=.; -checks=*; -warnings-as-errors=*;)
🌐
Daniel Sieger
danielsieger.com › blog › 2021 › 12 › 21 › clang-tidy-cmake.html
Using clang-tidy with CMake - Daniel Sieger
December 21, 2021 - For the second step, you tell CMake to use clang-tidy by setting the CXX_CLANG_TIDY property for your build target:
🌐
Mbed OS
forums.mbed.com › mbed os
How to activate clang-tidy checks - Mbed OS - Arm Mbed OS support forum
January 12, 2022 - Unfortunately, after compiling, there is no warning or error telling me this. This is my .clang-tidy file Checks: '*' CheckOptions: - key: modernize-use-nullptr.NullMacros value: NULL,CUSTOM_NULL I really don’t know how to activate clang-tidy. As I understand it, I...
🌐
LLVM
releases.llvm.org › 3.9.0 › tools › clang › tools › extra › docs › clang-tidy › index.html
Clang-Tidy — Extra Clang Tools 3.9 documentation
Use with -checks=* to list all available checks. -p=<string> - Build path -system-headers - Display the errors from system headers. -warnings-as-errors=<string> - Upgrades warnings to errors. Same format as '-checks'. This option's value is appended to the value of the 'WarningsAsErrors' option in .clang-tidy file, if any.
🌐
Hacker News
news.ycombinator.com › item
What's the difference between clang-format and clang-tidy? Do they have differen... | Hacker News
March 9, 2019 - clang-tidy does some deeper inspection and can be used to flag things that are "bad practice", not just "bad formatting". There's a big list of checks here: · https://clang.llvm.org/extra/clang-tidy/checks/list.html
🌐
PyPI
pypi.org › project › clang-tidy
clang-tidy · PyPI
The clang-tidy-wheel repository provides the logic to build and publish binary wheels of the clang-tidy utility. In order to add a new release, the following steps are necessary: Edit the version file to reflect the new version. Make a GitHub release to trigger the GitHub Actions release workflow. Alternatively, the workflow can be triggered manually. On manual triggers, the following input variables are available: use_qemu: Whether to build targets that require emulation (default: true)
      » pip install clang-tidy
    
Published   Mar 30, 2026
Version   22.1.0.1
🌐
CMake Discourse
discourse.cmake.org › usage
How to run clang-tidy with option --fix or --export-fixes - Usage - CMake Discourse
November 12, 2021 - The tool clang-tidy checks code against a vast set of rules, and suggests improvements. In a complex project, however, it is prohibitively difficult to run clang-tidy directly from the command line, since it needs include paths and other options just like a regular compilation command needs.
🌐
Gjbex
gjbex.github.io › Defensive_programming_and_debugging › CodeValidation › StaticCodeAnalyzers › clang_tidy
Clang Tidy - Defensive programming and debugging
To see which checks are enabled, simply run clang-tidy with the -list-checks options, i.e., ... You will see that by default, only checks with the prefix clang-analyzer are enabled, in total some 80 checks at the time of writing. However, many more checks can be enable in addition to these ...