Technologies & Solutions
Monday, 10. October 2022., 14:30
Hall B
45'
Having code quality in mind when developing is very important and by following best practices you can save yourselves a lot of trouble down the line.
SonarQube is one of the tools that allows us to better track issues in the code and also helps us prevent them while programming. The Sonar tools are widely used in Java development, but in most cases only the predefined set of rules is used.
In this workshop I will demonstrate how you can extend the default rule suite from SonarQube with your own custom-made rules. This can be particular useful if you work with the technologies not supported by the Sonar ruleset or you would like to enforce some internal guidelines for which the rules do not already exist. The presentation will mainly consist of a live coding session in which I'll show how to create custom Sonar rules for Java. Utilizing a template project provided by SonarSource, I will create a new custom rule and accompanying unit tests. Once created, the rule will be deployed to a local SonarQube instance and added to the quality profile. After everything is configured, I will demonstrate rule usage from the end-user perspective when developing in IntelliJ with help of the SonarLint plugin.