diff --git a/AUTHORS b/AUTHORS index aab918ac2..98cfb7305 100644 --- a/AUTHORS +++ b/AUTHORS @@ -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 Joshua Thijssen -Zach Weaver +Zach Weaver \ No newline at end of file diff --git a/scripts/sort_authors.py b/scripts/sort_authors.py new file mode 100644 index 000000000..6c24a4c5f --- /dev/null +++ b/scripts/sort_authors.py @@ -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))