Skip to content

Commit 8252506

Browse files
committed
contributors.py: Sort contributors by last contributor's year (newest first)
1 parent aa4fa90 commit 8252506

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

scripts/contributors.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,16 @@ def compress(years):
101101
if verbose:
102102
print("Years for each contributor...")
103103
print('')
104-
for author in sorted(names):
104+
105+
# sort authors by last contribution date (newest first)
106+
def last_year(name):
107+
return sorted(list(names[name]))[-1]
108+
109+
for author in sorted(list(names), key=last_year, reverse=True):
105110
years = list(names[author])
106111
yearstr = compress(years)
107112

108-
if 1: #DEBUG
113+
if 0: #DEBUG
109114
print(years, yearstr, author)
110115
else:
111116
print(yearstr, author)

0 commit comments

Comments
 (0)