Hello everyone,
I hope you are all doing well.
We have been using SonarQube successfully for several years and truly value the product and its continuous evolution. I would like to share some feedback regarding the HTML rule set, based on our experience in a long-running project.
In our project, we build user interfaces using XHTML. During analysis, these files are evaluated using the HTML ruleset, which works well in general. However, we have repeatedly encountered situations where important best‑practice or quality rules appear to be missing. A few examples:
-
<label>elements should only be used with a correspondingforattribute -
<img>tags should always define analtattribute -
HTML pages should inherit from the project’s base template rather than being created independently
There are more similar cases where project‑ or organization‑specific conventions would benefit greatly from rule-based validation.
We fully understand that implementing custom rules individually for customers would not be feasible. However, many teams like ours could help themselves if there were a way to define custom rules. For XML files, SonarQube already provides a very powerful XPath-based rule template, which we have found extremely useful.
Would it be possible to provide a similar XPath rule template for HTML as well? This would give teams more flexibility, allow them to enforce accessibility and architectural conventions, and further increase the value of the HTML analysis.
Thank you very much for considering this suggestion, and for your ongoing work on SonarQube.
Best regards,
Andreas Igel