Hi, team.
I wanted to share with you my experiences when developing a plugin for SonarQube.
My requirements were to build a plugin for two mainframe languages / formats.
When I started learning the technical requirements for SonarQube I saw that SonarQube doesn’t offer an easy way to develop plugins: the developer must learn about text parsers, SonarQube plugin internal APIs and a Java development framework.
I didn’t found also a generic plugin that would be capable to analyse every type of
language and dynamically add rules without developing then in Java and rebuilding a plugin.
Then, I decided to develop this kind of plugin to, when possible, try to cover these features:
- Dynamic creation and modification of rules. Only a SonarQube restart is required, at most.
- The rules are programmed with Javascript and configured with json.
- The rules repository could be a database or a directory of files
- The AST tree is generated from ANTLR4 grammar files.
- There are Javascript APIs that allow to walk along the AST tree to ease the analysis of source files from the scanner.
- The rule developer can create Javascript libraries to add language specific APIs to the generic ones.
Is it possible, the SonarQube team could allow this kind of rule development for future SonarQube versions?.
Thank you for this wonderful platform.
Best regards.