Home:ALL Converter>how to configure sonarlint in VScode for C language?

how to configure sonarlint in VScode for C language?

Ask Time:2022-07-05T10:37:14         Author:ayman magdy

Json Formatter

I'm practising clean code and I installed sonarlint as a static testing tool to help me write clean code. after installing the editor rises this notification

SonarLint is unable to analyze C and C++ file(s) because there is no configured compilation database.

after some searching, I found that I should add a file with a name

compile_commands.json.

this file should be exported automatically by cmake after adding this option

CMAKE_EXPORT_COMPILE_COMMANDS

where can I add this option in VScode.

this link is where the vscode redirected me to creat the required .json file

Author:ayman magdy,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/72863481/how-to-configure-sonarlint-in-vscode-for-c-language
yy