Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MAINT] Update contributor table generator style #1805

Merged
merged 3 commits into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions src/appendices/contributors.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ ecosystem (in alphabetical order).
If you contributed to the BIDS ecosystem and your name is not listed, please add it.

<!-- THE SECTION BELOW IS AUTOMATICALLY GENERATED -->
<!--lint ignore -->
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spent way too long trying to figure out why what I wrote is giving a slightly different result. Who cares about fences on an auto-generated table?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ha yeah I recognize those lines with wrong fencing issues...

I had not managed to figure out either what was going on... So resorted to manual fixes the few times I ran it.

I prefer you very pragmatic approach.


| name | contributions |
| ---------------------------------------------------- | -------------------------------------- |
Expand Down Expand Up @@ -121,7 +122,7 @@ If you contributed to the BIDS ecosystem and your name is not listed, please add
| Dianne Patterson | 📖 |
| Dimitri Papadopoulos Orfanos | 📖💡🤔💬💻 |
| Dmitry Petrov | 📖💻 |
| Dora Hermes | 📖💻✅🔍🤔 |
| Dora Hermes | 📖💻✅🔍🤔 |
| Dorien Huijser | 📖 |
| Douglas N. Greve | 📖 |
| Duncan Macleod | 📖🚇 |
Expand Down Expand Up @@ -194,7 +195,7 @@ If you contributed to the BIDS ecosystem and your name is not listed, please add
| Jeanette Mumford | 📖 |
| Jefferson Casimir | 🔧 |
| Jeffrey G. Ojemann | 📖 |
| Jeffrey S. Grethe | 💬🐛✅📢💻 |
| Jeffrey S. Grethe | 💬🐛✅📢💻 |
| JegouA | 💻 |
| Jelle Dalenberg | 📖 |
| Jeremy Moreau | 📖💡 |
Expand All @@ -211,7 +212,7 @@ If you contributed to the BIDS ecosystem and your name is not listed, please add
| Jose Manuel Saborit | 📖 |
| Joseph Wexler | 📖💡 |
| Joseph Woods | 📖 |
| Julia Guiomar Niso Galán | 🤔🎨🔍👀📋📝🔧🐛💻🔣✅💬📖💡📢 |
| Julia Guiomar Niso Galán | 🤔🎨🔍👀📋📝🔧🐛💻🔣✅💬📖💡📢 |
| Julia Sprenger | 📖 |
| Julien Cohen-Adad | 📖🔣🤔 |
| Julius Welzel | 📖💡🐛💻🔣🤔💬📓 |
Expand Down Expand Up @@ -269,7 +270,7 @@ If you contributed to the BIDS ecosystem and your name is not listed, please add
| Michael Hanke | 📖🤔🔧🐛📢 |
| Michael P. Harms | 📖⚠️🔧 |
| Michael P. Milham | 💡🔍 |
| Michael P. Notter | 💬📝✅📢📖 |
| Michael P. Notter | 💬📝✅📢📖 |
| Michael Schirner | 📖 |
| Mikaël Naveau | 🐛 |
| Nader Pouratian | 📖 |
Expand All @@ -288,7 +289,7 @@ If you contributed to the BIDS ecosystem and your name is not listed, please add
| Patricia Clement | 💬🐛💻📖🔣💡📋🤔📆⚠️📢 |
| Patrick Park | 📖💡💬💻 |
| Paule-Joanne Toussaint | 📖 |
| Peer Herholz | 💬📖👀🔧✅📢 |
| Peer Herholz | 💬📖👀🔧✅📢 |
| Petra Ritter | 📖 |
| Pierre Rioux | 📖 |
| Pieter Vandemaele | 📖💻 |
Expand Down Expand Up @@ -318,7 +319,7 @@ If you contributed to the BIDS ecosystem and your name is not listed, please add
| Shashank Bansal | 📖 |
| Sjoerd B. Vos | 📖 |
| Soichi Hayashi | 📖🔧🐛 |
| Stefan Appelhoff | 📖💬🤔🐛💡💻👀⚠️📢✅🔧🔌📝🚧🔣 |
| Stefan Appelhoff | 📖💬🤔🐛💡💻👀⚠️📢✅🔧🔌📝🚧🔣 |
| Stephan Bickel | 📖 |
| Steven Meisler | 🐛💻💬🔧📓 |
| Suyash Bhogawar | 📖💡⚠️🔧💬 |
Expand Down
20 changes: 9 additions & 11 deletions tools/print_contributors.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,23 @@


def contributor_table_header(max_name_length, max_contrib_length):
return f"""| name{" " * (max_name_length-4)} | contributions{" " * (max_contrib_length-13)} |
| {"-" * max_name_length} | {"-"*max_contrib_length} |
return f"""\
| {"name":<{max_name_length}} | {"contributions":<{max_contrib_length}} |
| {"":-<{max_name_length}} | {"":-<{max_contrib_length}} |
"""


def create_line_contributor(
contributor: dict[str, str], max_name_length: int, max_contrib_length: int
):
name = contributor["name"]
emap = emoji_map()
contributions = "".join(
emoji.emojize(emap[cont]) for cont in contributor["contributions"]
)

line = f"| {name}{' '*(max_name_length-len(name))} | "

nb_contrib = len(contributor["contributions"]) * 2
for contrib in contributor["contributions"]:
line += emoji.emojize(emoji_map()[contrib])

line += f"{' '*(max_contrib_length-nb_contrib)} |\n"

return line
pad = max_contrib_length - len(contributor["contributions"]) * 2
return f"| {name:<{max_name_length}} | {contributions}{'':<{pad}} |\n"


def main():
Expand Down