Can we define our own rules in Sonar Cloud for a particular language?

Right now in SonarCloud it was taking Sonar way built-in rules, but I need to create a rule of my own, so that the code can catch a bug based on my defined rules.

Is there any way in SonarCloud to define the rules?

Hey there.

Custom rules are not supported in SonarCloud, except for importing External Analyzer Reports or Generic Issue Data. Both these options give the possibility to write rules in another tool and then import the report in SonarCloud.

You’re also welcome to suggest new rules here.

Hey @Colin ,
The document link (Generic Issue Data | SonarCloud Docs) which you mentioned, even the external tools does not have support to C language.

Is there any external tool or a way to customize the rules for C language?

I can confirm that you can use Generic Issue Data with C code.

You mentioned that Generic issue data - SonarCloud will give possibility to write rules in another tool and then import that report.

Which tool is that? where I can write the rules to C code.

Any tool. A script that matches on regex – writing custom checkers in clang… anything that can eventually produce a generic issue format report.