From 3a5a4d9227f25ac9863b0af8e242b39bef71ae9c Mon Sep 17 00:00:00 2001 From: Leedehai <18319900+Leedehai@users.noreply.github.com> Date: Sat, 23 Mar 2024 07:53:17 -0400 Subject: [PATCH] Exclude bots from the doc's contributor list (#3731) --- docs/src/contribs.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/src/contribs.rs b/docs/src/contribs.rs index 58a730e22..d9824c39a 100644 --- a/docs/src/contribs.rs +++ b/docs/src/contribs.rs @@ -9,6 +9,7 @@ use crate::{Html, Resolver}; /// Build HTML detailing the contributors between two tags. pub fn contributors(resolver: &dyn Resolver, from: &str, to: &str) -> Option { let staff = ["laurmaedje", "reknih"]; + let bots = ["dependabot[bot]"]; // Determine number of contributions per person. let mut contributors = HashMap::::new(); @@ -26,7 +27,10 @@ pub fn contributors(resolver: &dyn Resolver, from: &str, to: &str) -> Option = contributors .into_values() - .filter(|c| !staff.contains(&c.login.as_str())) + .filter(|c| { + let login = c.login.as_str(); + !staff.contains(&login) && !bots.contains(&login) + }) .collect(); // Sort by highest number of commits.