Post

Clang-tidy Notes

Clang-tidy notes

clang-tidy 15 documentation minimal .clang-tidy Intro to Clang-tidy clang-tidy checks to avoid

System Headers

Setting the HeaderFilterRegex in .clang-tidy to '.*' should tell it to ignore system headers.

Fixes

Fixes can be automatically applied with the -fix flag. Multiple C++ files don’t handle fixes well as each instance of clang-tidy will try to apply the same fixes at the same time. Instead either perform fixes manually or export the fixes with the -export-fixes command and try applying them with clang-apply-replacements <directory-to-fix-yaml-files>

run-clang-tidy.py

run-clang-tidy.py is an LLVM tool for running clang-tidy in parallel over an entire codebase. It requires a JSON Compile Database which can be generated from GNU Make using Bear.

This post is licensed under CC BY 4.0 by the author.