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
|
- @alex-ds13
|
||||||
- @B0ney
|
- @B0ney
|
||||||
- @bbb651
|
- @bbb651
|
||||||
|
- @EmmanuelDodoo
|
||||||
- @JL710
|
- @JL710
|
||||||
- @kenz-gelsoft
|
- @kenz-gelsoft
|
||||||
- @mfreeborn
|
- @mfreeborn
|
||||||
|
|
@ -288,7 +289,6 @@ Many thanks to...
|
||||||
- @13r0ck
|
- @13r0ck
|
||||||
- @airstrike
|
- @airstrike
|
||||||
- @bungoboingo
|
- @bungoboingo
|
||||||
- @EmmanuelDodoo
|
|
||||||
- @karolisr
|
- @karolisr
|
||||||
- @Remmirad
|
- @Remmirad
|
||||||
- @semiversus
|
- @semiversus
|
||||||
|
|
@ -296,9 +296,11 @@ Many thanks to...
|
||||||
- @xosxos
|
- @xosxos
|
||||||
- @Zarthus
|
- @Zarthus
|
||||||
- @7h0ma5
|
- @7h0ma5
|
||||||
|
- @7sDream
|
||||||
- @Adam-Ladd
|
- @Adam-Ladd
|
||||||
- @AMS21
|
- @AMS21
|
||||||
- @Atreyagaurav
|
- @Atreyagaurav
|
||||||
|
- @AustinEvansWX
|
||||||
- @Azorlogh
|
- @Azorlogh
|
||||||
- @berserkware
|
- @berserkware
|
||||||
- @biglizards
|
- @biglizards
|
||||||
|
|
@ -312,6 +314,7 @@ Many thanks to...
|
||||||
- @DavidAguilo
|
- @DavidAguilo
|
||||||
- @dcz-self
|
- @dcz-self
|
||||||
- @dejang
|
- @dejang
|
||||||
|
- @dependabot[bot]
|
||||||
- @EleDiaz
|
- @EleDiaz
|
||||||
- @ellieplayswow
|
- @ellieplayswow
|
||||||
- @Exidex
|
- @Exidex
|
||||||
|
|
@ -325,6 +328,7 @@ Many thanks to...
|
||||||
- @ids1024
|
- @ids1024
|
||||||
- @iMohmmedSA
|
- @iMohmmedSA
|
||||||
- @Integral-Tech
|
- @Integral-Tech
|
||||||
|
- @inthehack
|
||||||
- @jakobhellermann
|
- @jakobhellermann
|
||||||
- @janTatesa
|
- @janTatesa
|
||||||
- @jbirnick
|
- @jbirnick
|
||||||
|
|
@ -347,6 +351,7 @@ Many thanks to...
|
||||||
- @lmaxyz
|
- @lmaxyz
|
||||||
- @mariinkys
|
- @mariinkys
|
||||||
- @max-privatevoid
|
- @max-privatevoid
|
||||||
|
- @MichelleGranat
|
||||||
- @misaka10987
|
- @misaka10987
|
||||||
- @mytdragon
|
- @mytdragon
|
||||||
- @njust
|
- @njust
|
||||||
|
|
@ -363,17 +368,12 @@ Many thanks to...
|
||||||
- @sgued
|
- @sgued
|
||||||
- @sopvop
|
- @sopvop
|
||||||
- @T-256
|
- @T-256
|
||||||
|
- @tafia
|
||||||
- @thorn132
|
- @thorn132
|
||||||
- @tigerros
|
- @tigerros
|
||||||
- @tsuza
|
- @tsuza
|
||||||
- @vincenthz
|
- @vincenthz
|
||||||
- @will-lynas
|
- @will-lynas
|
||||||
- @7sDream
|
|
||||||
- @AustinEvansWX
|
|
||||||
- @dependabot[bot]
|
|
||||||
- @inthehack
|
|
||||||
- @MichelleGranat
|
|
||||||
- @tafia
|
|
||||||
|
|
||||||
## [0.13.1] - 2024-09-19
|
## [0.13.1] - 2024-09-19
|
||||||
### Added
|
### Added
|
||||||
|
|
|
||||||
|
|
@ -103,8 +103,6 @@ impl Changelog {
|
||||||
|
|
||||||
let mut candidates = Contribution::list().await?;
|
let mut candidates = Contribution::list().await?;
|
||||||
|
|
||||||
dbg!(candidates.len());
|
|
||||||
|
|
||||||
for candidate in &candidates {
|
for candidate in &candidates {
|
||||||
*changelog
|
*changelog
|
||||||
.contributions
|
.contributions
|
||||||
|
|
@ -112,6 +110,12 @@ impl Changelog {
|
||||||
.or_default() += 1;
|
.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() {
|
for reviewed_entry in changelog.entries() {
|
||||||
candidates.retain(|candidate| candidate.id != reviewed_entry);
|
candidates.retain(|candidate| candidate.id != reviewed_entry);
|
||||||
}
|
}
|
||||||
|
|
@ -166,13 +170,20 @@ impl Changelog {
|
||||||
|
|
||||||
target.push(item);
|
target.push(item);
|
||||||
|
|
||||||
|
*self.contributions.entry(entry.author.clone()).or_default() += 1;
|
||||||
|
|
||||||
if entry.author != "hecrj" && !self.authors.contains(&entry.author) {
|
if entry.author != "hecrj" && !self.authors.contains(&entry.author) {
|
||||||
self.authors.push(entry.author);
|
self.authors.push(entry.author);
|
||||||
}
|
}
|
||||||
|
|
||||||
self.authors.sort_by_key(|author| {
|
self.authors.sort_by(|a, b| {
|
||||||
usize::MAX
|
self.contributions
|
||||||
- self.contributions.get(author).copied().unwrap_or_default()
|
.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