How can I create a custom rule to ignore html lang attribute

Hi we are using jsp/html with decorator and the lang attribute is defined there on top. Sonar is identifying these are bugs. Is there a way i mark its not a bug for my system always? or write a rule to accept it

Hi Mohammad,

Welcome to the SonarSource community!

Although the WCAG specification requires that every HTML page lang attribute has valid language tag, you can create your own quality profile for the HTML language (extending Sonar way) in which rule Web:S5254 (“html element should have a language attribute”) has a lower severity.

If you do not extend Sonar way, your custom quality profile may omit that rule entirely! But it is much more work to maintain your own QP, so I encourage you to consider my first suggestion.

To make and use your own quality profile, start here:
Quality Profiles | SonarQube Docs.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.