summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.flake87
-rw-r--r--.pre-commit-config.yaml5
-rw-r--r--README.rst4
-rw-r--r--docs/conf.py26
-rw-r--r--pyproject.toml3
-rw-r--r--pytest.ini2
-rw-r--r--setup.cfg1
7 files changed, 33 insertions, 15 deletions
diff --git a/.flake8 b/.flake8
index 04d2d97..790c109 100644
--- a/.flake8
+++ b/.flake8
@@ -1,10 +1,9 @@
[flake8]
+max-line-length = 88
ignore =
- # Allow tabs for indentation
- W191
- # Workaround for https://github.com/PyCQA/pycodestyle/issues/836
- E117
# W503 violates spec https://github.com/PyCQA/pycodestyle/issues/513
W503
# W504 has issues https://github.com/OCA/maintainer-quality-tools/issues/545
W504
+ # Black creates whitespace before colon
+ E203
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
new file mode 100644
index 0000000..922d942
--- /dev/null
+++ b/.pre-commit-config.yaml
@@ -0,0 +1,5 @@
+repos:
+- repo: https://github.com/ambv/black
+ rev: 18.9b0
+ hooks:
+ - id: black
diff --git a/README.rst b/README.rst
index 78750be..7050da3 100644
--- a/README.rst
+++ b/README.rst
@@ -6,6 +6,10 @@
.. image:: https://img.shields.io/travis/jaraco/skeleton/master.svg
:target: https://travis-ci.org/jaraco/skeleton
+.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
+ :target: https://github.com/ambv/black
+ :alt: Code style: Black
+
.. .. image:: https://img.shields.io/appveyor/ci/jaraco/skeleton/master.svg
.. :target: https://ci.appveyor.com/project/jaraco/skeleton/branch/master
diff --git a/docs/conf.py b/docs/conf.py
index 49a855f..77cef34 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -1,26 +1,32 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
-extensions = ["sphinx.ext.autodoc", "jaraco.packaging.sphinx", "rst.linker"]
+extensions = [
+ 'sphinx.ext.autodoc',
+ 'jaraco.packaging.sphinx',
+ 'rst.linker',
+]
master_doc = "index"
link_files = {
- "../CHANGES.rst": dict(
- using=dict(GH="https://github.com"),
+ '../CHANGES.rst': dict(
+ using=dict(
+ GH='https://github.com',
+ ),
replace=[
dict(
- pattern=r"(Issue #|\B#)(?P<issue>\d+)",
- url="{package_url}/issues/{issue}",
+ pattern=r'(Issue #|\B#)(?P<issue>\d+)',
+ url='{package_url}/issues/{issue}',
),
dict(
- pattern=r"^(?m)((?P<scm_version>v?\d+(\.\d+){1,2}))\n[-=]+\n",
- with_scm="{text}\n{rev[timestamp]:%d %b %Y}\n",
+ pattern=r'^(?m)((?P<scm_version>v?\d+(\.\d+){1,2}))\n[-=]+\n',
+ with_scm='{text}\n{rev[timestamp]:%d %b %Y}\n',
),
dict(
- pattern=r"PEP[- ](?P<pep_number>\d+)",
- url="https://www.python.org/dev/peps/pep-{pep_number:0>4}/",
+ pattern=r'PEP[- ](?P<pep_number>\d+)',
+ url='https://www.python.org/dev/peps/pep-{pep_number:0>4}/',
),
],
- )
+ ),
}
diff --git a/pyproject.toml b/pyproject.toml
index 6f0a516..3afc8c3 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,3 +1,6 @@
[build-system]
requires = ["setuptools>=34.4", "wheel", "setuptools_scm>=1.15"]
build-backend = "setuptools.build_meta"
+
+[tool.black]
+skip-string-normalization = true
diff --git a/pytest.ini b/pytest.ini
index 9b3c1ec..10681ad 100644
--- a/pytest.ini
+++ b/pytest.ini
@@ -1,6 +1,6 @@
[pytest]
norecursedirs=dist build .tox .eggs
-addopts=--doctest-modules --flake8
+addopts=--doctest-modules --flake8 --black
doctest_optionflags=ALLOW_UNICODE ELLIPSIS
filterwarnings=
ignore:Possible nested set::pycodestyle:113
diff --git a/setup.cfg b/setup.cfg
index 726b307..a3eb3c9 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -29,6 +29,7 @@ testing =
pytest >= 3.5, !=3.7.3
pytest-checkdocs
pytest-flake8
+ pytest-black
# local