Skip to content

Documentation: usage in CI #162

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,17 @@ Sample `.pre-commit-config.yaml`:

Since `black` is currently a moving target, it is suggested to pin `black`
to a specific version using `additional_dependencies`.

## usage in CI

The `blacken-docs` command returns a non-zero exit code if it detects any Python syntax errors, or if it applies any changes to files.

This means you can use the command in a CI step to check that your documentation has been correctly formatted.

This example uses GitHub Actions syntax, checking the formatting of all `.rst` documentation files.

```yaml
- name: Check if blacken-docs needs to be run
run: |
blacken-docs docs/*.rst
```