mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Refs #34140 -- Added configurations to run blacken-docs linter and adjusted docs.
This adds: - GitHub actions, - tox configuration, - pre-commit hook, and - makefile rules to run blacken-docs linter. Co-authored-by: David Smith <smithdc@gmail.com>
This commit is contained in:
21
.github/workflows/docs.yml
vendored
21
.github/workflows/docs.yml
vendored
@@ -38,3 +38,24 @@ jobs:
|
||||
run: |
|
||||
cd docs
|
||||
sphinx-build -b spelling -n -q -W --keep-going -d _build/doctrees -D language=en_US -j auto . _build/spelling
|
||||
|
||||
blacken-docs:
|
||||
runs-on: ubuntu-latest
|
||||
name: blacken-docs
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.11'
|
||||
- run: python -m pip install blacken-docs
|
||||
- name: Build docs
|
||||
run: |
|
||||
cd docs
|
||||
make black
|
||||
RESULT=`cat _build/black/output.txt`
|
||||
if [ "$RESULT" -gt 0 ]; then
|
||||
echo "💥 📢 Code blocks in documentation must be reformatted with blacken-docs 📢 💥"
|
||||
fi;
|
||||
exit $RESULT
|
||||
|
||||
Reference in New Issue
Block a user