Skip to content

Commit

Permalink
Merge pull request #231 from gosub-browser/ahmed/sort-authors
Browse files Browse the repository at this point in the history
chore: add python script to sort authors automatically
  • Loading branch information
jaytaph authored Nov 5, 2023
2 parents d62ece2 + 619546d commit 7b85dc6
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
4 changes: 2 additions & 2 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# This file contains a non-exhaustive list of contributors to the Gosub Engine project.
# If you want to be added to this list, please update this file with your pull request.
#
# Please keep this list sorted alphabetically by last name.
# Please keep this list sorted alphabetically or run `python scripts/sort_authors.py` to auto-sort the authors list.

Ahmed Ibrahim <[email protected]>
Joshua Thijssen <[email protected]>
Zach Weaver <[email protected]>
Zach Weaver <[email protected]>
20 changes: 20 additions & 0 deletions scripts/sort_authors.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FILE_NAME = 'AUTHORS'

with open(FILE_NAME, 'r') as f:
lines = [line.strip() for line in f.readlines()]


header: list[str] = []
authors: list[str] = []

for line in lines:
if line == '' or line.startswith('#'):
header.append(line)
else:
authors.append(line)


sorted_lines = header + sorted(authors)

with open(FILE_NAME, 'w') as f:
f.write('\n'.join(sorted_lines))

0 comments on commit 7b85dc6

Please sign in to comment.