Skip to content

Commit 85d1bdd

Browse files
committed
[build] Add build check to ensure CLI docs are up to date #457
1 parent 9d0af3c commit 85d1bdd

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

.github/workflows/generate-docs.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,15 @@ jobs:
5151
git config --global user.name github-actions
5252
git config --global user.email github-actions@github.com
5353
54+
- name: Check CLI Documentation
55+
shell: bash
56+
run: |
57+
if [[ `git status --porcelain=1 | wc -l` -ne 0 ]]; then
58+
echo "CLI documentation is of date: docs/cli.rst does not match output after running docs/generate_cli_docs.py!"
59+
echo "Re-run `python docs/generate_cli_docs.py` to update and commit the result."
60+
exit 1
61+
fi
62+
5463
- name: Generate Docs
5564
run: |
5665
sphinx-build -b html docs build

docs/cli.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.. NOTE: This file is auto-generated by docs/generate_cli_docs.py and should not be modified.
12
23
************************************************************************
34
``scenedetect`` 🎬 Command

docs/generate_cli_docs.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ def create_help() -> ty.Tuple[str, ty.List[str]]:
267267
def main():
268268
help, commands = create_help()
269269
help = patch_help(help, commands)
270+
help = ".. NOTE: This file is auto-generated by docs/generate_cli_docs.py and should not be modified.\n" + help
270271
with open("docs/cli.rst", "wb") as f:
271272
f.write(help.encode())
272273

0 commit comments

Comments
 (0)