Michael Merickel
2018-10-10 851c368e3c158e264358de10446f5b5de240e534
configure black and update flake8
2 files added
4 files modified
127 ■■■■ changed files
.flake8 18 ●●●●● patch | view | raw | blame | history
.travis.yml 4 ●●●● patch | view | raw | blame | history
MANIFEST.in 3 ●●●● patch | view | raw | blame | history
pyproject.toml 31 ●●●●● patch | view | raw | blame | history
setup.cfg 53 ●●●●● patch | view | raw | blame | history
tox.ini 18 ●●●● patch | view | raw | blame | history
.flake8
New file
@@ -0,0 +1,18 @@
[flake8]
ignore =
    # E203: whitespace before ':' (black fails to be PEP8 compliant)
    E203
    # E731: do not assign a lambda expression, use a def
    E731
    # W503: line break before binary operator (flake8 is not PEP8 compliant)
    W503
exclude =
    src/pyramid/compat.py
    src/pyramid/scaffolds/alchemy
    src/pyramid/scaffolds/starter
    src/pyramid/scaffolds/zodb
    tests/fixtures
    tests/pkgs
    tests/test_config/pkgs
    tests/test_config/path
show-source = True
.travis.yml
@@ -16,11 +16,11 @@
          env: TOXENV=pypy
        - python: pypy3
          env: TOXENV=pypy3
        - python: 3.5
        - python: 3.6
          env: TOXENV=py2-cover,py3-cover,coverage
        - python: 3.5
          env: TOXENV=docs
        - python: 3.5
        - python: 3.6
          env: TOXENV=lint
        - python: 3.7
          env: TOXENV=py37
MANIFEST.in
@@ -8,7 +8,8 @@
include CONTRIBUTORS.txt LICENSE.txt COPYRIGHT.txt
include contributing.md RELEASING.txt
include .coveragerc tox.ini appveyor.yml .travis.yml rtd.txt
include .coveragerc .flake8 setup.cfg pyproject.toml
include tox.ini appveyor.yml .travis.yml rtd.txt
graft .github
include HACKING.txt hacking-tox.ini
pyproject.toml
New file
@@ -0,0 +1,31 @@
[build-system]
requires = ["setuptools", "wheel"]
[tool.black]
line-length = 79
skip-string-normalization = true
py36 = false
exclude = '''
/(
    \.git
  | \.mypy_cache
  | \.tox
  | \.venv
  | \.pytest_cache
  | dist
  | build
  | docs
  | src/pyramid/scaffolds/alchemy
  | src/pyramid/scaffolds/starter
  | src/pyramid/scaffolds/zodb
)/
'''
 # This next section only exists for people that have their editors
# automatically call isort, black already sorts entries on its own when run.
[tool.isort]
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
combine_as_imports = true
line_length = 79
setup.cfg
@@ -16,59 +16,6 @@
[metadata]
license_file = LICENSE.txt
[flake8]
ignore =
    # E121: continuation line under-indented for hanging indent
    E121,
    # E123: closing bracket does not match indentation of opening bracket's line
    E123,
    # E125: continuation line with same indent as next logical line
    E125,
    # E127: continuation line over-indented for visual indent
    E127,
    # E128: continuation line under-indented for visual indent
    E128,
    # E129: visually indented line with same indent as next logical line
    E129,
    # E201: whitespace after '('
    E201,
    # E202: whitespace before ')'
    E202,
    # E231: missing whitespace after ',', ';', or ':'
    E231,
    # E261: at least two spaces before inline comment
    E261,
    # E262: inline comment should start with '# '
    E262,
    # E265: block comment should start with '# '
    E265,
    # E266: too many leading '#' for block comment
    E266,
    # E301: expected 1 blank line, found 0
    E301,
    # E302: expected 2 blank lines, found 0
    E302,
    # E303: too many blank lines (3)
    E303,
    # E305: expected 2 blank lines after class or function definition, found 1
    E305,
    # E306: expected 1 blank line before a nested definition, found 0
    E306,
    # E501: line too long (82 > 79 characters)
    E501,
    # E731: do not assign a lambda expression, use a def
    E731,
    # W291: trailing whitespace
    W291,
    # W293: blank line contains whitespace
    W293,
    # W391: blank line at end of file
    W391,
    # W503: line break before binary operator
    W503
exclude = pyramid/tests/,pyramid/compat.py,pyramid/resource.py
show-source = True
[check-manifest]
ignore =
    .gitignore
tox.ini
@@ -17,7 +17,7 @@
    pypy: pypy
    pypy3: pypy3
    py2: python2.7
    py3: python3.5
    py3: python3.6
commands =
    nosetests --with-xunit --xunit-file=nosetests-{envname}.xml {posargs:}
@@ -63,13 +63,15 @@
[testenv:lint]
skip_install = true
basepython = python3.5
basepython = python3.6
commands =
    flake8 pyramid/
    flake8 src/pyramid tests setup.py
    black --check --diff src/pyramid tests setup.py
    python setup.py check -r -s -m
    check-manifest
deps =
    flake8
    black
    readme_renderer
    check-manifest
@@ -113,7 +115,7 @@
[testenv:coverage]
skip_install = true
basepython = python3.5
basepython = python3.6
commands =
    coverage erase
    coverage combine
@@ -124,6 +126,14 @@
setenv =
    COVERAGE_FILE=.coverage
[testenv:black]
skip_install = true
basepython = python3.6
commands =
    black src/pyramid tests setup.py
deps =
    black
[testenv:build]
skip_install = true
basepython = python3.6