From bd36a341b4ca5a8f3bffddeca659578089302f1a Mon Sep 17 00:00:00 2001 From: Oleh Prypin Date: Sun, 4 Jun 2023 12:06:03 +0200 Subject: [PATCH] Use a forked best-of-generator instead of postprocessing --- .github/workflows/update-best-of-list.yml | 9 +++----- reformat.py | 27 ----------------------- 2 files changed, 3 insertions(+), 33 deletions(-) delete mode 100644 reformat.py diff --git a/.github/workflows/update-best-of-list.yml b/.github/workflows/update-best-of-list.yml index b422df0..13b5366 100644 --- a/.github/workflows/update-best-of-list.yml +++ b/.github/workflows/update-best-of-list.yml @@ -43,13 +43,10 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: install best-of-generator + run: pip install git+https://github.com/mkdocs/best-of-generator - name: update-best-of-list - uses: best-of-lists/best-of-update-action@v0.8.5 - with: - libraries_key: ${{ secrets.LIBRARIES_KEY }} - github_key: ${{ secrets.GITHUB_TOKEN }} - - name: restyle-readme - run: python reformat.py + run: best-of generate projects.yaml --github-key=${{ secrets.GITHUB_TOKEN }} --libraries-key=${{ secrets.LIBRARIES_KEY }} - name: push-update uses: stefanzweifel/git-auto-commit-action@v4 with: diff --git a/reformat.py b/reformat.py deleted file mode 100644 index da214de..0000000 --- a/reformat.py +++ /dev/null @@ -1,27 +0,0 @@ -import re -from pathlib import Path - -line_re = re.compile(r"^(?P
)?(?P[^(]+)\((?P[^)]+)\) - (?P.+) (?P(", "") - markers = markers.replace(" ", " · ") - details_start = groups["details"] or "" - details_end = "" if details_start else "" - new_line = f"{details_start}{link} - {metrics} · {markers}
{summary}{details_end}" - new_lines.append(new_line) - else: - new_lines.append(line) - readme.write_text("\n".join(new_lines))