Fix contribution counting in changelog generator
This commit is contained in:
parent
8eb5577c5b
commit
aa8c0c3f4c
2 changed files with 23 additions and 12 deletions
14
CHANGELOG.md
14
CHANGELOG.md
|
|
@ -280,6 +280,7 @@ Many thanks to...
|
|||
- @alex-ds13
|
||||
- @B0ney
|
||||
- @bbb651
|
||||
- @EmmanuelDodoo
|
||||
- @JL710
|
||||
- @kenz-gelsoft
|
||||
- @mfreeborn
|
||||
|
|
@ -288,7 +289,6 @@ Many thanks to...
|
|||
- @13r0ck
|
||||
- @airstrike
|
||||
- @bungoboingo
|
||||
- @EmmanuelDodoo
|
||||
- @karolisr
|
||||
- @Remmirad
|
||||
- @semiversus
|
||||
|
|
@ -296,9 +296,11 @@ Many thanks to...
|
|||
- @xosxos
|
||||
- @Zarthus
|
||||
- @7h0ma5
|
||||
- @7sDream
|
||||
- @Adam-Ladd
|
||||
- @AMS21
|
||||
- @Atreyagaurav
|
||||
- @AustinEvansWX
|
||||
- @Azorlogh
|
||||
- @berserkware
|
||||
- @biglizards
|
||||
|
|
@ -312,6 +314,7 @@ Many thanks to...
|
|||
- @DavidAguilo
|
||||
- @dcz-self
|
||||
- @dejang
|
||||
- @dependabot[bot]
|
||||
- @EleDiaz
|
||||
- @ellieplayswow
|
||||
- @Exidex
|
||||
|
|
@ -325,6 +328,7 @@ Many thanks to...
|
|||
- @ids1024
|
||||
- @iMohmmedSA
|
||||
- @Integral-Tech
|
||||
- @inthehack
|
||||
- @jakobhellermann
|
||||
- @janTatesa
|
||||
- @jbirnick
|
||||
|
|
@ -347,6 +351,7 @@ Many thanks to...
|
|||
- @lmaxyz
|
||||
- @mariinkys
|
||||
- @max-privatevoid
|
||||
- @MichelleGranat
|
||||
- @misaka10987
|
||||
- @mytdragon
|
||||
- @njust
|
||||
|
|
@ -363,17 +368,12 @@ Many thanks to...
|
|||
- @sgued
|
||||
- @sopvop
|
||||
- @T-256
|
||||
- @tafia
|
||||
- @thorn132
|
||||
- @tigerros
|
||||
- @tsuza
|
||||
- @vincenthz
|
||||
- @will-lynas
|
||||
- @7sDream
|
||||
- @AustinEvansWX
|
||||
- @dependabot[bot]
|
||||
- @inthehack
|
||||
- @MichelleGranat
|
||||
- @tafia
|
||||
|
||||
## [0.13.1] - 2024-09-19
|
||||
### Added
|
||||
|
|
|
|||
|
|
@ -103,8 +103,6 @@ impl Changelog {
|
|||
|
||||
let mut candidates = Contribution::list().await?;
|
||||
|
||||
dbg!(candidates.len());
|
||||
|
||||
for candidate in &candidates {
|
||||
*changelog
|
||||
.contributions
|
||||
|
|
@ -112,6 +110,12 @@ impl Changelog {
|
|||
.or_default() += 1;
|
||||
}
|
||||
|
||||
for author in &changelog.authors {
|
||||
if !changelog.contributions.contains_key(author) {
|
||||
changelog.contributions.insert(author.clone(), 1);
|
||||
}
|
||||
}
|
||||
|
||||
for reviewed_entry in changelog.entries() {
|
||||
candidates.retain(|candidate| candidate.id != reviewed_entry);
|
||||
}
|
||||
|
|
@ -166,13 +170,20 @@ impl Changelog {
|
|||
|
||||
target.push(item);
|
||||
|
||||
*self.contributions.entry(entry.author.clone()).or_default() += 1;
|
||||
|
||||
if entry.author != "hecrj" && !self.authors.contains(&entry.author) {
|
||||
self.authors.push(entry.author);
|
||||
}
|
||||
|
||||
self.authors.sort_by_key(|author| {
|
||||
usize::MAX
|
||||
- self.contributions.get(author).copied().unwrap_or_default()
|
||||
self.authors.sort_by(|a, b| {
|
||||
self.contributions
|
||||
.get(a)
|
||||
.copied()
|
||||
.unwrap_or_default()
|
||||
.cmp(&self.contributions.get(b).copied().unwrap_or_default())
|
||||
.reverse()
|
||||
.then(a.to_lowercase().cmp(&b.to_lowercase()))
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue