Skip to content

Commit

Permalink
Merge pull request #511 from akaihola/verify-readme-diff-output
Browse files Browse the repository at this point in the history
In CI builds, show a diff of changed `--help` output if `README.rst` is outdated.
  • Loading branch information
akaihola authored Mar 8, 2024
2 parents 61c78d1 + 984deef commit 8059d1d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
14 changes: 1 addition & 13 deletions .github/workflows/help-in-readme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,4 @@ jobs:
- uses: actions/checkout@v4
- run: pip install '.[flynt,isort]'
- name: Verify that README contains output of darker --help
shell: python
run: |
import sys
from pathlib import Path
from pprint import pprint
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()
if usage in readme:
sys.exit(0)
pprint(str.splitlines(usage, keepends=True), width=94)
sys.exit(1)
run: darker --verify-readme
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Added
This makes the option compatible with Black.
- Upgrade NixOS tests to use Python 3.11 on both Linux and macOS.
- Move ``git_repo`` fixture to ``darkgraylib``.
- In CI builds, show a diff of changed ``--help`` output if ``README.rst`` is outdated.

Fixed
-----
Expand Down

0 comments on commit 8059d1d

Please sign in to comment.