Hello, I want to add my projects new rules which is name convention in my c project. There are some name conventions for cfamily sonar-way rules but I want little bit complex rule for name convention. the issue is there is no global variable name convetion, which I need in my project. There are a local variable rule but it includes parameters too (rule id is c:S117).
Another problem is there is no name convention rule for data type. Like I want to make first two character “c_” for of “char” type variable names.
I just want to make new rule that checks the condition of local and global variables. Here an example:
int g_i_someInt = 0; // starts with 'g' because of global variable and 'i' for int variable
int main(){
char l_c_someChar = 'D' // starts with 'l' for local variable and 'c' for char data type
return 0;
}
I search on internet and forums, and something has taken my attention: “custom plugins” is there any way to add this kind of rule directly to the sonarqube or should I write a plugin for add this rule to my project.
The second way I thought is adding a custom report to sonarqube, I know that we can add sonarqube a custom reports (like coverage reports), so there is a way that I can write a code wich scans the code and generates the report and then I can add the report to sonarqube, but if I am able to do this sonarqubes suggested way, I prefer to do suggested way.
If I need add a report for sonarqube for this kind of naming rule output how should I do that and and what kind of way? or if I need to add (or write) plugin to sonarqube what should I do