Add black formatting

This commit is contained in:
Robbe Sneyders
2022-04-27 23:36:03 +02:00
parent 1d3d6c582d
commit 29747fafc3
3 changed files with 26 additions and 3 deletions

View File

@@ -9,6 +9,7 @@ repos:
files: "^connexion/"
additional_dependencies:
- flake8-rst-docstrings==0.2.3
- repo: https://github.com/PyCQA/isort
rev: 5.10.1
hooks:
@@ -24,3 +25,19 @@ repos:
name: isort tests
files: "^tests/"
args: ["--project", "conftest", "--thirdparty", "connexion", "--check-only", "--diff"]
- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
name: black
files: "^connexion/"
args: ["connexion"]
- id: black
name: black examples
files: "^examples/"
args: ["examples"]
- id: black
name: black tests
files: "^tests/"
args: ["tests"]

View File

@@ -583,8 +583,8 @@ Contributing to Connexion/TODOs
We welcome your ideas, issues, and pull requests. Just follow the
usual/standard GitHub practices.
For easy development, please install connexion in editable mode with the :code:`tests` extra, and
install the pre-commit hooks.
For easy development, install connexion in editable mode with the :code:`tests` extra, and
install the pre-commit hooks to automatically run black formatting and static analysis checks.
.. code-block:: bash

View File

@@ -1,7 +1,13 @@
[flake8]
max-line-length=170
exclude=connexion/__init__.py
rst-roles=class
# https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html#flake8
# Longest docstring in current code base
max-line-length=137
extend-ignore=E203
[isort]
profile = black
[tox]
envlist =