Skip to content

Commit cf0c83c

Browse files
committed
Add formatting with black
1 parent 1e2594f commit cf0c83c

File tree

4 files changed

+24
-10
lines changed

4 files changed

+24
-10
lines changed

.travis.yml

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ matrix:
1919
- env: TOXENV=py39-django31-drfmaster
2020

2121
include:
22+
- python: 3.6
23+
env: TOXENV=black
2224
- python: 3.6
2325
env: TOXENV=lint
2426
- python: 3.6
+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
black==20.8b1
12
flake8==3.8.4
23
flake8-isort==4.0.0
34
isort==5.6.4

setup.cfg

+15-10
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,34 @@ test = pytest
55
universal = 1
66

77
[flake8]
8-
ignore = F405,W504
9-
max-line-length = 100
8+
max-line-length = 88
9+
extend-ignore =
10+
# whitespace before ':' - disabled as not PEP8 compliant
11+
E203,
12+
# line too long (managed by black)
13+
E501,
14+
# usage of star imports
15+
# TODO mark star imports directly in code to ignore this error
16+
F405
1017
exclude =
11-
snapshots
1218
build/lib,
13-
docs/conf.py,
14-
migrations,
1519
.eggs
1620
.tox,
1721
env
1822
.venv
1923

2024
[isort]
21-
indent = 4
25+
multi_line_output = 3
26+
include_trailing_comma = True
27+
force_grid_wrap = 0
28+
use_parentheses = True
29+
ensure_newline_before_comments = True
30+
line_length = 88
2231
known_first_party = rest_framework_json_api
2332
# This is to "trick" isort into putting example below DJA imports.
2433
known_localfolder = example
25-
line_length = 100
26-
multi_line_output = 3
2734
skip=
2835
build/lib,
29-
docs/conf.py,
30-
migrations,
3136
.eggs
3237
.tox,
3338
env

tox.ini

+6
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ setenv =
2020
commands =
2121
pytest --cov --no-cov-on-fail --cov-report xml {posargs}
2222

23+
[testenv:black]
24+
basepython = python3.6
25+
deps =
26+
-rrequirements/requirements-codestyle.txt
27+
commands = black --check .
28+
2329
[testenv:lint]
2430
basepython = python3.6
2531
deps =

0 commit comments

Comments
 (0)