-
Notifications
You must be signed in to change notification settings - Fork 329
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use the same update-authors.py as AC
- Loading branch information
Chris Houseknecht
committed
Sep 29, 2016
1 parent
8685e15
commit 7c5a71a
Showing
1 changed file
with
5 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
|
||
# cp this file to .git/hooks/pre-commit to automatically update AUTHORS.md with each commit | ||
|
||
from __future__ import absolute_import | ||
|
||
import logging | ||
|
@@ -30,17 +28,14 @@ | |
commit_data['deletions'] += int(count) | ||
else: | ||
commit_data['files'] += int(count) | ||
if "Houseknecht" in author or "houseknecht" in author or "vagrant" in author: | ||
author = "Chris Houskenecht <[email protected]>" | ||
user_score = user_scores.setdefault(author, 0) | ||
user_scores[author] = user_score + commit_data['insertions'] + commit_data['deletions'] | ||
|
||
user_scores = user_scores.items() | ||
sorted_user_scores = sorted(user_scores, key=lambda tpl: tpl[1], reverse=True) | ||
|
||
with open('AUTHORS','w') as f: | ||
f.write(u"Ansible Container has been contribued to by the following authors:\n") | ||
f.write(u"(This list is automatically generated - please file an issue for corrections)\n") | ||
f.write(u"\n") | ||
for author, _ in sorted_user_scores: | ||
f.write(author + u"\n") | ||
print 'Ansible Container has been contribued to by the following authors:' | ||
print '(This list is automatically generated - please file an issue for corrections)' | ||
print '' | ||
for author, _ in sorted_user_scores: | ||
print author |