From 56c2eb2db5284d1c43332c07fad6d85a8d338cd3 Mon Sep 17 00:00:00 2001 From: Correl Roush Date: Wed, 12 Dec 2018 01:35:54 -0500 Subject: [PATCH] Integrate the Black code formatting tool --- .travis.yml | 1 + README.md | 1 + pyproject.toml | 13 +++++++++++++ setup.cfg | 2 +- setup.py | 9 ++++++++- 5 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 pyproject.toml diff --git a/.travis.yml b/.travis.yml index d215097..504f9e7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,7 @@ dist: xenial sudo: true before_install: - pip install codecov + - pip install black install: - pip install -e . script: diff --git a/README.md b/README.md index d3e81d7..cff4667 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ [![Build Status](https://travis-ci.com/correl/typesafe-monads.svg?branch=master)](https://travis-ci.com/correl/typesafe-monads) [![codecov](https://codecov.io/gh/correl/typesafe-monads/branch/master/graph/badge.svg)](https://codecov.io/gh/correl/typesafe-monads) +[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black) This is an experiment in building monads in Python supported by strict type annotations. The goal is to be able to compose monads with the diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..a7c75bf --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,13 @@ +[tool.black] +line-length = 88 +py36 = true +include = '\.pyi?$' +exclude = ''' +/( + \.eggs + | \.git + | \.mypy_cache + | build + | dist +)/ +''' diff --git a/setup.cfg b/setup.cfg index c063e26..a8f0911 100644 --- a/setup.cfg +++ b/setup.cfg @@ -2,4 +2,4 @@ test=pytest [tool:pytest] -addopts = --mypy --cov monads --cov-report xml:reports/coverage.xml +addopts = --black --mypy --cov monads --cov-report xml:reports/coverage.xml diff --git a/setup.py b/setup.py index 1acc92e..b62cb58 100644 --- a/setup.py +++ b/setup.py @@ -17,7 +17,14 @@ setup( package_data={"monads": ["py.typed"]}, include_package_data=True, setup_requires=["pytest-runner"], - tests_require=["pytest", "mypy", "pytest-cov", "pytest-mypy"], + tests_require=[ + "pytest", + "black", + "mypy", + "pytest-cov", + "pytest-black", + "pytest-mypy", + ], classifiers=[ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers",