Skip to content

Commit

Permalink
Prevent duplicates in github issue stats
Browse files Browse the repository at this point in the history
  • Loading branch information
maxandersen authored and psss committed Jan 3, 2024
1 parent 98dfd9a commit a8ba4e6
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions did/plugins/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,19 @@ def __str__(self):
self.owner, self.project,
str(self.id).zfill(PADDING), self.data["title"])

def __eq__(self, other):
""" Equality comparison """
if isinstance(other, Issue):
return (
self.owner == other.owner
and self.project == other.project
and self.id == other.id)
return False

def __hash__(self):
""" Hash function """
return hash((self.owner, self.project, self.id))


# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Stats
Expand Down

0 comments on commit a8ba4e6

Please sign in to comment.