Top "Clang-tidy" questions

For questions about clang-tidy as a static analyzer and code modernization tool.

"Use of a signed integer operand with a binary bitwise operator" - when using unsigned short

In the following C snippet that checks if the first two bits of a 16-bit sequence are set: bool is_…

c clion clang-tidy
Inline way to disable clang-tidy checks

I'm trying to set up clang-tidy for a project. I'd like to be able to have clean output, and encourage …

c++ clang++ clang-tidy
Getting clang-tidy to fix header files

I'm in the process of moving a project currently compiling with gcc to clang, and have a bunch of warnings …

c++ clang++ llvm-clang automated-refactoring clang-tidy
clang-tidy: How to suppress warnings?

I recently started experimenting with the clang-tidy tool of llvm. Now I am trying to suppress false warnings from third …

suppress-warnings clang-static-analyzer clang-tidy
Clang-Tidy can't find my header files

new to clang and clang-tidy here. I have a project with this type of structure: project/ - build/ - cmake/ …

c++ clang clang-tidy
How to install clang-tidy on macOS?

How do you install clang-tidy on macOS? It seems quite easy to install clang-format (using brew) on macOS, but it …

macos clang-tidy
cmake clang-tidy (or other script) as custom target

I am trying to create a custom cmake target for clang-tidy, to lint my project. The source folder looks something …

cmake clang target lint clang-tidy
Ignore system headers in clang-tidy

tldr;> How do I hide warnings from system headers in clang-tidy? I have the following minimal example source file, …

c++ clang clang-static-analyzer libtooling clang-tidy
Ignore [clang-diagnostic-error] clang-tidy caused by 3rd party headers

I am using clang-tidy as a "linter" tool in development. I started to integrate 3rd party software into my code …

c++ header-files linter clang-tidy
Using clang-tidy to check c++17 code

I installed clang-tidy on Ubuntu using: sudo apt install clang-tidy I ran it on a simple C++ 17 file, and got …

c++ c++17 clang-tidy