Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions src/dvsim/testplan.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,18 +101,19 @@ def _validate(self) -> None:
msg = f"'tags' key in {self} is not a list."
raise ValueError(msg)

def has_tags(self, tags: set) -> bool:
"""Checks if the provided tags match the tags originally set.
def has_tags(self, tags: set[str]) -> bool:
"""Return true if the element matches the provided tags.

tags is a list of tags that are we are filtering this testpoints with.
Tags may be preceded with `-` to exclude the testpoints that contain
that tag.
The element should match every item in the set of tags. If one of these
items is preceded with "-", the meaning is negated (so the element
should not match the tag name).

Vacuously returns true if tags is an empty list.
"""
if not tags:
return True
If tags is empty, this will vacuously return true.

Args:
tags: The set of named tags against which to match.

"""
for tag in tags:
if tag.startswith("-"):
if tag[1:] in self.tags:
Expand Down
Loading