Home

Search IconIcon to open search

clangd and friends

# clangd

Provides IDE-like features for text editors through Language Server Protocol. Needs compile_commands.json for all the files to enable indexing and stuff. There are several ways to generate it. You can use -MJ flag with clang and concatenate the results into one file. Or use Bear. Or this Python thingie.

# clang-tidy

You have to create .clang-tidy file in the project root directory and specify the checks you need ( list of options). Example:

1
Checks: 'bugprone-*,cert-*,clang-analyzer-*,linuxkernel-*,misc-*,performance-*,readability-*,-readability-braces-around-statements,-readability-identifier-length,-bugprone-easily-swappable-parameters'

# clang-static-analyzer