diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index fa6dbd621d13aa5153d6463295f55083b937ad7a..42d61bb21575e2f1a026fd52b823903e6b3f7504 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -26,7 +26,7 @@ jobs:
       - name: Python Formatting
         uses: psf/black@stable
         with:
-          options: --check --extend-exclude '/(ext|doc/scripts/.*_theme|doc/scripts/inputs.py)'
+          options: --check
           src: scripts/build-catalogue.in .
       - name: Python analysis
         run: |
diff --git a/doc/contrib/coding-style.rst b/doc/contrib/coding-style.rst
index 4283138baae9ad1113b2c5873dfb69e0a7ebcd0f..7558f061e485b8ceec14ea9460254164057ba26a 100644
--- a/doc/contrib/coding-style.rst
+++ b/doc/contrib/coding-style.rst
@@ -15,7 +15,7 @@ run the following commands to apply it:
    # Install the formatter if not present
    pip install black
    # Automatically apply style. If unsure what this does read on.
-   black --extend-exclude '/(ext|doc/scripts/.*_theme)' . scripts/build-catalogue.in
+   black . scripts/build-catalogue.in
 
 The formatter can also be run with ``--check`` to list offending files and
 ``--diff`` to preview changes. Most editors can `integrate with black
diff --git a/pyproject.toml b/pyproject.toml
index 0d73254195b4c8aa4439c8455ef2d142066ec22f..cd9e92e2505ae3ccdf567ed011084b63c5dade1f 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -26,6 +26,12 @@ dependencies = [
     "numpy"
 ]
 
+[tool.black]
+line-length = 88
+target-version = ['py37', 'py38', 'py39', 'py310']
+include = '\.pyi?$'
+extend-exclude='^/(ext|doc/scripts/.*_theme|doc/scripts/inputs.py)'
+
 [tool.setuptools]
 py-modules = ["arbor"]