From cbb94e11dea2e6a94d9e68f6782494d3c36c9c79 Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Thu, 25 Apr 2024 06:41:47 -0400 Subject: [PATCH] [MAINT] Update contributor table generator style (#1805) * 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 --- src/appendices/contributors.md | 13 +++++++------ tools/print_contributors.py | 20 +++++++++----------- 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/src/appendices/contributors.md b/src/appendices/contributors.md index 2ffab4740f..f48586f04d 100644 --- a/src/appendices/contributors.md +++ b/src/appendices/contributors.md @@ -37,6 +37,7 @@ ecosystem (in alphabetical order). If you contributed to the BIDS ecosystem and your name is not listed, please add it. + | name | contributions | | ---------------------------------------------------- | -------------------------------------- | @@ -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 | πŸ“–πŸš‡ | @@ -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 | πŸ“–πŸ’‘ | @@ -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 | πŸ“–πŸ’‘πŸ›πŸ’»πŸ”£πŸ€”πŸ’¬πŸ““ | @@ -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 | πŸ“– | @@ -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 | πŸ“–πŸ’» | @@ -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 | πŸ“–πŸ’‘βš οΈπŸ”§πŸ’¬ | diff --git a/tools/print_contributors.py b/tools/print_contributors.py index c49ca6f823..29db86a39c 100644 --- a/tools/print_contributors.py +++ b/tools/print_contributors.py @@ -15,8 +15,9 @@ 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}} | """ @@ -24,16 +25,13 @@ 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():