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 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 -----