From 7132a4d0e58b3976cea9c9a42936cd6b30f12320 Mon Sep 17 00:00:00 2001 From: Antti Kaihola <13725+akaihola@users.noreply.github.com> Date: Wed, 27 Apr 2022 23:06:48 +0300 Subject: [PATCH 1/2] CI workflow to ensure README contains usage text --- .github/workflows/help-in-readme.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/help-in-readme.yml diff --git a/.github/workflows/help-in-readme.yml b/.github/workflows/help-in-readme.yml new file mode 100644 index 000000000..9dcee7dbc --- /dev/null +++ b/.github/workflows/help-in-readme.yml @@ -0,0 +1,18 @@ +--- +name: help-in-readme +on: [push] # yamllint disable-line rule:truthy +jobs: + help-in-readme: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - run: pip install -e '.[isort]' + - name: Verify that README contains output of darker --help + shell: python + run: | + from pathlib import Path + from subprocess import check_output, STDOUT + cmd = ["darker", "--options-for-readme"] + usage = check_output(cmd, stderr=STDOUT, encoding="utf-8") + readme = Path("README.rst").read_text() + assert usage in readme From 31092f1b5da7eeb5053db96d751b18fd4325fc2a Mon Sep 17 00:00:00 2001 From: Antti Kaihola <13725+akaihola@users.noreply.github.com> Date: Wed, 27 Apr 2022 23:38:02 +0300 Subject: [PATCH 2/2] Update change log --- CHANGES.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index f7d5d4988..d4cb9532d 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -5,6 +5,8 @@ These features will be included in the next release: Added ----- +- Add a CI workflow which verifies that the ``darker --help`` output in ``README.rst`` + is up to date. Fixed -----