[ADD] xml-tag-position: enforce id, t-if/t-else/t-elif and class positioning attribute rules#190
Merged
Merged
Conversation
f1ebf25 to
8fe73dd
Compare
JJRR5
reviewed
May 25, 2026
…tioning attribute rules Rename the check xml-id-position-first to xml-tag-position to support a more general set of attribute positioning constraints. Specifically: - t-if, t-else, and t-elif must always be the first attribute in any XML tag. - id, t-att-id, t-attf-id must be the second attribute - class, t-att-class, t-attf-class must be the third attribute Changes: - Refactor checks_odoo_module_xml.py to use a single check_xml_tag_position visitor and a unified autofix. - Update rewrite_start_tag in node_xml.py to accept a list of ordered attribute names, maintaining the specified sequence at the beginning of the tag. - Update test cases in test_repo/broken_module/template1.xml to cover these formatting rules. - Update tests/test_checks.py and tests/test_node_xml.py to adapt check names and check counts. - Regenerate README.md to document the new check and update examples.
a9f178a to
84674a0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.