diff --git a/ci/release_contributors.py b/ci/release_contributors.py index 50501233f60..071264eec56 100644 --- a/ci/release_contributors.py +++ b/ci/release_contributors.py @@ -7,6 +7,32 @@ co_author_re = re.compile(r"Co-authored-by: (?P[^<]+?) <(?P.+)>") +ignored = [ + {"name": "dependabot[bot]"}, + {"name": "pre-commit-ci[bot]"}, + { + "name": "Claude", + "email": [ + "noreply@anthropic.com", + "claude@anthropic.com", + "no-reply@anthropic.com", + ], + }, +] + + +def is_ignored(name, email): + # linear search, for now + for ignore in ignored: + if ignore["name"] != name: + continue + ignored_email = ignore.get("email") + if ignored_email is None or email in ignored_email: + return True + + return False + + def main(): repo = git.Repo(".") @@ -22,11 +48,8 @@ def main(): # deduplicate and ignore # TODO: extract ignores from .github/release.yml - ignored = ["dependabot", "pre-commit-ci"] unique_contributors = unique( - contributor - for contributor in contributors.values() - if contributor.removesuffix("[bot]") not in ignored + name for email, name in contributors.items() if not is_ignored(name, email) ) sorted_ = sorted(unique_contributors)