From 878f2784cb8a5d6c83aa118f3fd8d2dfab229cfc Mon Sep 17 00:00:00 2001
From: Matt Westcott <matt@west.co.tt>
Date: Wed, 21 Oct 2020 12:38:52 +0100
Subject: [PATCH] Add config section for doc8 in setup.cfg and ignore _build
 dir

---
 .circleci/config.yml | 2 +-
 Makefile             | 2 +-
 docs/Makefile        | 2 +-
 setup.cfg            | 4 ++++
 4 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/.circleci/config.yml b/.circleci/config.yml
index dbf33c26a8..94e9df467c 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -23,7 +23,7 @@ jobs:
       - run:
           shell: /bin/bash -e
           command: pipenv run jinjalint --parse-only wagtail | grep -v 'welcome_page.html:6:70' | tee /dev/tty | wc -l | grep -q '0'
-      - run: pipenv run doc8 --ignore D001 docs
+      - run: pipenv run doc8 docs
       - run: DATABASE_NAME=wagtail.db pipenv run python -u runtests.py
 
   frontend:
diff --git a/Makefile b/Makefile
index 859a615da4..3a2534d154 100644
--- a/Makefile
+++ b/Makefile
@@ -23,7 +23,7 @@ lint:
 	jinjalint --parse-only wagtail | grep -v 'welcome_page.html:6:70' | tee /dev/tty | wc -l | grep -q '0'
 	npm run lint:css --silent
 	npm run lint:js --silent
-	doc8 --ignore D001 docs
+	doc8 docs
 
 test:
 	python runtests.py
diff --git a/docs/Makefile b/docs/Makefile
index 367bcea197..15a41cf23e 100644
--- a/docs/Makefile
+++ b/docs/Makefile
@@ -60,7 +60,7 @@ spelling:
 	@echo "Spellcheck complete."
 
 lint:
-	doc8 --ignore D001 --ignore-path _build
+	doc8 --config ../setup.cfg
 
 dirhtml:
 	$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
diff --git a/setup.cfg b/setup.cfg
index 195bddb183..df8add32f5 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -14,6 +14,10 @@ ignore = D100,D101,D102,D103,D105,E501,W503,N806
 exclude = wagtail/project_template/*,node_modules,venv
 max-line-length = 120
 
+[doc8]
+ignore = D001
+ignore-path = _build,docs/_build
+
 [isort]
 line_length=100
 multi_line_output=4