Skip to content

Commit

Permalink
Use the same update-authors.py as AC
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Houseknecht committed Sep 29, 2016
1 parent 8685e15 commit 7c5a71a
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions update-authors.py
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
Expand Down Expand Up @@ -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

0 comments on commit 7c5a71a

Please sign in to comment.