Skip to content

Commit

Permalink
CI now shows a diff of changed --help output
Browse files Browse the repository at this point in the history
This is done if `README.rst` is outdated compared to what
`darker --options-for-readme` outputs.
  • Loading branch information
akaihola committed Mar 8, 2024
1 parent 61c78d1 commit 984deef
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 984deef

Please sign in to comment.