Add RequiredAttributeTemplateCheck as a new template rule#605
Conversation
Ruling ReportThe following ruling changes are in this PR: Rule:
|
b6541af to
8f9eba9
Compare
There was a problem hiding this comment.
by doing this you are effectively removing the rule. I think we cannot spot it because ruling does not have expected issues for RequiredAttributeCheck. Double check adding issues on ruling for this rule, I expect nothing will be raised. Have a look that for ruling we instantiate a template if we want the rule enabled:
I would suggest to create a new rule for this, so we don't affect existing users
Allows users to create custom instances of RequiredAttributeCheck with their own attribute/element configurations, consistent with how IllegalAttributeCheck already works. Fixes https://community.sonarsource.com/t/track-missing-expected-attributes/179339 Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Adds a new template rule that allows users to create custom instances checking for required attributes on specific HTML elements, without affecting the existing RequiredAttributeCheck rule and its users. Also instantiates the template in ruling tests with img.alt as an example. Fixes https://community.sonarsource.com/t/track-missing-expected-attributes/179339 Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Aligns with the RSPEC convention of using S-numbers for new rules. Renames resource files from RequiredAttributeTemplateCheck to S8488 and updates all references accordingly. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
6ccc9c3 to
fb3d3b1
Compare
|




Summary
RequiredAttributeTemplateChecktemplate rule — users can create custom instances with their owntag.attributeconfigurationsRequiredAttributeCheckuntouched so existing users are not affectedimg.altas a concrete example (Template_RequiredImgAlt)Fixes https://community.sonarsource.com/t/track-missing-expected-attributes/179339
🤖 Generated with Claude Code