diff options
-rw-r--r-- | .flake8 | 5 | ||||
-rw-r--r-- | .pre-commit-config.yaml | 5 | ||||
-rw-r--r-- | README.rst | 4 | ||||
-rw-r--r-- | docs/conf.py | 44 | ||||
-rw-r--r-- | pyproject.toml | 3 | ||||
-rw-r--r-- | pytest.ini | 2 | ||||
-rw-r--r-- | setup.cfg | 1 | ||||
-rw-r--r-- | setup.py | 2 |
8 files changed, 40 insertions, 26 deletions
@@ -1,8 +1,9 @@ [flake8] +max-line-length = 88 ignore = - # Allow tabs for indentation - W191 # 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 @@ -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 aeda56c..d9ea1a6 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -2,31 +2,31 @@ # -*- coding: utf-8 -*- extensions = [ - 'sphinx.ext.autodoc', - 'jaraco.packaging.sphinx', - 'rst.linker', + 'sphinx.ext.autodoc', + 'jaraco.packaging.sphinx', + 'rst.linker', ] master_doc = 'index' link_files = { - '../CHANGES.rst': dict( - using=dict( - GH='https://github.com', - ), - replace=[ - dict( - 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', - ), - dict( - pattern=r'PEP[- ](?P<pep_number>\d+)', - url='https://www.python.org/dev/peps/pep-{pep_number:0>4}/', - ), - ], - ), + '../CHANGES.rst': dict( + using=dict( + GH='https://github.com', + ), + replace=[ + dict( + 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', + ), + dict( + 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 65d7426..a8b44c1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,2 +1,5 @@ [build-system] requires = ["setuptools>=34.4", "wheel", "setuptools_scm>=1.15"] + +[tool.black] +skip-string-normalization = true @@ -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 @@ -33,6 +33,7 @@ testing = pytest-sugar >= 0.9.1 collective.checkdocs pytest-flake8 + pytest-black # local @@ -5,4 +5,4 @@ import setuptools if __name__ == '__main__': - setuptools.setup(use_scm_version=True) + setuptools.setup(use_scm_version=True) |