To use custom Quality Profiles with selected language rules, first create a new quality profile in sonarqube.
To create a new profile, go to “Quality Profiles” and click on “Create” as seen below.
Now select a name and a language for the new profile.
After selecting the language a parent can be selected. All rules of the parent will be imported.
After clicking on “Create” in this dialogue, you will see the profile overview.
On the left side active and inactive rules will be shown. Active rules are used in the profile in contrast to inactive, which arent.
To add rules to this profile click on “Activate More” on the left.
Now all rules for the selected language are shown. Specific rules can be selected or via “Bulk Change” all filtered languages. Single rules can be activated / deactivated and searched by filters or via name.
To associate the profile with projects go back to “Quality Profiles” - your profile.
On projects click on “Change Projects”, in the dialogue switch to all and select the project to use the profile.
As you seen in the profile overview, there are Built in and DEFAULT profiles.
Built in profiles are created from the language plugins and normally have all rules applied.
Default profiles are used, when no specific language is associated to a project. To set a custom profile as default, go to the custom quality profile settings and select “Set as Default”.