Skip to content

Commit

Permalink
[MAINT] Update contributor table generator style (#1805)
Browse files Browse the repository at this point in the history
* chore(code-style): Rewrite f-strings in print_contributors.py to outrage flake8 less

* chore(render): Rerender contributors.md

* chore(style): Ignore linting errors in auto-generated table
  • Loading branch information
effigies authored Apr 25, 2024
1 parent b5fd938 commit cbb94e1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 17 deletions.
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 -->

| 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

0 comments on commit cbb94e1

Please sign in to comment.