I am using clang-tidy on ubuntu. First of all download it from package manager:
sudo apt-get install clang-tidy
Then install the clang-tidy extension in vscode (Clang-Tidy
notskm.clang-tidy).
Once installed click on the extension settings

Locate Clang-tidy: Checks, click on Edit in settings.json.
In your settings.json file will be generated this code:
"clang-tidy.checks": [
]
You can paste here the checks that you want to enable.
To see the available checks you can run this command from terminal:
clang-tidy --list-checks -checks='*'
For example you could take all the modernize checks, and you would end up with something like this:
"clang-tidy.checks": [
"modernize-*"
]
Save your settings.json and go to your code. When saving a file the linter should now tell you what are the problems in your code.
