-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add generated CONTRIBUTORS.txt, fixes #47
- Loading branch information
Showing
3 changed files
with
63 additions
and
0 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
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Thanks goes to these wonderful people: | ||
|
||
Tamás Nepusz (@ntamas) | ||
Szabolcs Horvát (@szhorvat) | ||
Jérôme Benoit (@jgmbenoit) | ||
Robert Schütz (@dotlambda) | ||
Biswapriyo Nath (@Biswa96) | ||
Michael Orlitzky (@orlitzky) | ||
|
||
This project follows the [all-contributors][1] specification. Contributions of any kind welcome! | ||
|
||
This file is an automatically generated, plain-text version of CONTRIBUTORS.md. | ||
|
||
[1]: https://github.com/all-contributors/all-contributors |
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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/usr/bin/env python3 | ||
"""Update the contents of CONTRIBUTORS.txt based on .all-contributorsrc.""" | ||
|
||
from json import load | ||
from os import chdir | ||
from pathlib import Path | ||
|
||
|
||
HEADER = """\ | ||
Thanks goes to these wonderful people: | ||
""" | ||
|
||
FOOTER = """\ | ||
This project follows the [all-contributors][1] specification. Contributions of any kind welcome! | ||
This file is an automatically generated, plain-text version of CONTRIBUTORS.md. | ||
[1]: https://github.com/all-contributors/all-contributors | ||
""" | ||
|
||
def main(): | ||
root_dir = Path(__file__).parent.parent.parent | ||
chdir(root_dir) | ||
|
||
with (root_dir / ".all-contributorsrc").open("r") as fp: | ||
contributors = load(fp)["contributors"] | ||
|
||
with (root_dir / "CONTRIBUTORS.txt").open("w") as fp: | ||
fp.write(HEADER) | ||
for c in contributors: | ||
if c["name"]: | ||
fp.write(f"{c['name']} (@{c['login']})\n") | ||
else: | ||
fp.write(f"@{c['login']}\n") | ||
fp.write(FOOTER) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |