A Schematron-based SonarQube plugin for XSL code quality measurement.
A Schematron-based SonarQube plugin for XSL code quality measurement.
it brings the benefits of SonarQube to XSL projects :
Contact : Sonar-XSL-Plugin is mainly maintained by Jim Etevenard
Development roadmap and upcoming updates :
See main milestones and active issues on Github
This plugin runs an XSL-related Best-practice Schematron on each XSLT file of your project.
It embeds the xslt-quality schematron from @mricaud.
That Schematron Script, based on Mukul Gandhi’s work, checks some common XSL pitfalls.
*:
in xpath statements should be avoidedxsl:for-each
on nodes may be a clue of procedural programming ;
You should maybe consider using xsl:apply-templates
insteadtrue() or
false() value should be used instead of litteral strings
‘true’ and
‘false’`Since this plugin is open source, one can embed any additional Schematron script to support custom rules.
Public releases are available on Github :
https://github.com/sonar-xsl/Sonar-XSL-Plugin/releases
sonar-xsl-plugin-x.x.x.jar
from the link above$SONARQUBE_HOME/extensions/plugins
In most cases, on Linux, $SONARQUBE_HOME
refers to /opt/sonarqube/
making the full path to be /opt/sonarqube/extensions/plugins/
The process of installing a SonarQube plugin is documented here :
https://docs.sonarqube.org/latest/setup/install-plugin/, see § Manual Installation
The Sonar-XSL-Plugin is built via Maven.
Running mvn package
will invoke the sonar-packaging-maven-plugin to build a SonarQube-Ready JAR file.
The JAR to be installed in SonarQube will be delivered at /sonar-xsl-plugin/target/sonar-xsl-plugin-1.x.x.jar
It embeds two main modules
Makes the link between Schematron and the SonarQube API.
Cf. https://github.com/sonar-xsl/Sonar-Schematron-Reactor
Out of the box, the unique xslt-quality
Packaged for this plugin, via the dedicated Maven Plugin. (See module ./sonar-schematron-packaging-plugin)
This mechanism can be used to extend this plugin :
:+1: Yes, it works !
See Issues and next Milestones
As for now, if you wana try it, you have to build it locally from the sources.
NB : The actual implementation is based on the Skeleton XSLT implementation of ISO-Schematron.
To bring XSLT code coverage into SonarQube