diff --git a/rose/rule_parser.py b/rose/rule_parser.py index 4345855..e693784 100644 --- a/rose/rule_parser.py +++ b/rose/rule_parser.py @@ -17,7 +17,7 @@ import click -from rose.common import RoseError, RoseExpectedError +from rose.common import RoseError, RoseExpectedError, uniq logger = logging.getLogger(__name__) @@ -293,10 +293,10 @@ def __str__(self) -> str: return r def __init__(self, tags: Sequence[ExpandableTag], pattern: MatcherPattern) -> None: - _tags: set[Tag] = set() + _tags: list[Tag] = [] for t in tags: - _tags.update(ALL_TAGS[t]) - self.tags = list(_tags) + _tags.extend(ALL_TAGS[t]) + self.tags = uniq(_tags) self.pattern = pattern @classmethod @@ -392,10 +392,10 @@ def __init__( pattern: MatcherPattern | None = None, ) -> None: self.behavior = behavior - _tags: set[Tag] = set() + _tags: list[Tag] = [] for t in tags: - _tags.update(ALL_TAGS[t]) - self.tags = list(_tags) + _tags.extend(ALL_TAGS[t]) + self.tags = uniq(_tags) self.pattern = pattern def __str__(self) -> str: