Skip to content

Commit

Permalink
Refactor contributor filtering functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Satishpokala124 authored and bartaz committed Jul 22, 2024
1 parent 48b4f8c commit 92066e4
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions webapp/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,25 +187,20 @@ def _filter_team_members_from_contributors(contributors):
]


def _is_not_renovate_bot(contributor):
# Using "login" to check for renovate-bot as
# GitHub treats it as a user, i.e., type: "User"

return contributor["login"] != "renovate-bot"


def _filter_bots_from_contributors(contributors):
return [
contributor
for contributor in contributors
if (
contributor["type"].lower() != "bot"
and _is_not_renovate_bot(contributor)
contributor["type"].lower() != "bot"
and contributor["id"] != 25180681 # renovate-bot
)
]


def _filter_contributors(contributors):
# Distinguish team_members and bots from contributors

return _filter_bots_from_contributors(
_filter_team_members_from_contributors(contributors)
)
Expand Down

0 comments on commit 92066e4

Please sign in to comment.