Skip to content
Open
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 @@ -83,18 +83,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
elements is preceded with "-", the meaning is negated (so the element
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this might be intended to be:

Suggested change
elements is preceded with "-", the meaning is negated (so the element
tags is preceded with "-", the meaning is negated (so the element

(or "items" also makes sense in the given context)

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