summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeedehai <18319900+Leedehai@users.noreply.github.com>2024-03-23 07:53:17 -0400
committerGitHub <noreply@github.com>2024-03-23 11:53:17 +0000
commitbf519162ffa02b55daa2dd9ec48018d52cc6c930 (patch)
tree351edfc300c45f57860dacbb4ddff2e2b8766523
parentd1568a55831f4074c7bcfe7d0bb983055e1709d3 (diff)
Exclude bots from the doc's contributor list (#3731)
-rw-r--r--docs/src/contribs.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/docs/src/contribs.rs b/docs/src/contribs.rs
index 58a730e2..d9824c39 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<Html> {
let staff = ["laurmaedje", "reknih"];
+ let bots = ["dependabot[bot]"];
// Determine number of contributions per person.
let mut contributors = HashMap::<String, Contributor>::new();
@@ -26,7 +27,10 @@ pub fn contributors(resolver: &dyn Resolver, from: &str, to: &str) -> Option<Htm
// Keep only non-staff people.
let mut contributors: Vec<_> = 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.