otterdog
otterdog copied to clipboard
Strange diff for branch_protection_rule with square brackets in pattern
When definining a branch protection rule with pattern [345].[x0123456789], the computed diff shows:
+ add branch_protection_rule[pattern="[345].", repository=vert.x] {
(from https://github.com/eclipse-vertx/.eclipsefdn/pull/15#issuecomment-2904490895)
My guess is that it's only a display issue, but would be great to verify
As suspected, it is only a diff printing issue. The pattern in the created rule is correct after apply:
omg, we use now rich to format text for the console, and by coincidence, rich uses square brackets as markup tags:
header = header + f'\\[{key}="[bold]{self.get_key_value()}[/]"'
now rich will probably interpret [x0123456789] in some way as markup and not print it. So need to escape the text.
https://rich.readthedocs.io/en/stable/markup.html#escaping
Thank you for the patch!