Skip to content

Commit 18e90f7

Browse files
committed
Use black and flake8
1 parent a35ddb6 commit 18e90f7

File tree

2 files changed

+33
-109
lines changed

2 files changed

+33
-109
lines changed

pyproject.toml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[build-system]
2-
requires = ["setuptools", "wheel"]
2+
requires = ["setuptools>=40.7.0", "wheel>=0.31.1"]
33

44
[tool.towncrier]
55
package = "rest_framework_jwt"
@@ -36,3 +36,24 @@ requires = ["setuptools", "wheel"]
3636
directory = "misc"
3737
name = "Misc"
3838
showcontent = true
39+
40+
41+
[tool.black]
42+
line-length = 79
43+
target-version = ['py37']
44+
include = '\.pyi?$'
45+
exclude = '''
46+
(
47+
/(
48+
\.eggs # exclude a few common directories in the
49+
| \.git # root of the project
50+
| \.tox
51+
| \.venv
52+
| \.changelog.d
53+
| _build
54+
| build
55+
| dist
56+
| locale
57+
)/
58+
)
59+
'''

setup.cfg

Lines changed: 11 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,8 @@ dev =
5252
tox
5353
lint =
5454
isort
55-
yapf
56-
pylint
57-
pylint-django==0.11.1
55+
black
56+
flake8
5857
test =
5958
mock
6059
pytest>=3.0
@@ -72,7 +71,7 @@ universal = 1
7271
test=pytest
7372

7473
[tool:pytest]
75-
DJANGO_SETTINGS_MODULE=tests.settings
74+
DJANGO_SETTINGS_MODULE=demo.settings.test
7675
addopts =
7776
--cov-config .coveragerc
7877
--cov-report term
@@ -98,113 +97,17 @@ source =
9897

9998
[isort]
10099
# Reference: https://github.com/timothycrosley/isort/wiki/isort-Settings
101-
skip=.tox,bin,changelogs,example,docs
102100
atomic=true
103-
multi_line_output=2
101+
force_grid_wrap=0
102+
include_trailing_comma=true
103+
multi_line_output=3
104+
line_length=79
105+
lines_after_imports=2
106+
lines_between_types=1
104107
known_django=django
105108
known_rest_framework=rest_framework
106109
known_third_party=mock,pytz,faker,model_utils,responses,factory
107110
known_first_party=rest_framework_jwt
111+
skip=.git,__pycache__,docs,.tox,migrations,requirements,venv,.venv,wsgi.py,bin,changelogs,example
108112
sections=FUTURE,STDLIB,THIRDPARTY,DJANGO,REST_FRAMEWORK,FIRSTPARTY,LOCALFOLDER
109-
110-
[yapf]
111-
based_on_style = pep8
112-
113-
# Allow splits before the dictionary value.
114-
allow_split_before_dict_value=True
115-
116-
# Do not split consecutive brackets. Only relevant when
117-
# dedent_closing_brackets is set. For example:
118-
#
119-
# call_func_that_takes_a_dict(
120-
# {
121-
# 'key1': 'value1',
122-
# 'key2': 'value2',
123-
# }
124-
# )
125-
#
126-
# would reformat to:
127-
#
128-
# call_func_that_takes_a_dict({
129-
# 'key1': 'value1',
130-
# 'key2': 'value2',
131-
# })
132-
coalesce_brackets=True
133-
134-
# Put closing brackets on a separate line, dedented, if the bracketed
135-
# expression can't fit in a single line. Applies to all kinds of brackets,
136-
# including function definitions and calls. For example:
137-
#
138-
# config = {
139-
# 'key1': 'value1',
140-
# 'key2': 'value2',
141-
# } # <--- this bracket is dedented and on a separate line
142-
#
143-
# time_series = self.remote_client.query_entity_counters(
144-
# entity='dev3246.region1',
145-
# key='dns.query_latency_tcp',
146-
# transform=Transformation.AVERAGE(window=timedelta(seconds=60)),
147-
# start_ts=now()-timedelta(days=3),
148-
# end_ts=now(),
149-
# ) # <--- this bracket is dedented and on a separate line
150-
dedent_closing_brackets=True
151-
152-
# Indent the dictionary value if it cannot fit on the same line as the
153-
# dictionary key. For example:
154-
#
155-
# config = {
156-
# 'key1':
157-
# 'value1',
158-
# 'key2': value1 +
159-
# value2,
160-
# }
161-
indent_dictionary_value=True
162-
163-
# If an argument / parameter list is going to be split, then split before
164-
# the first argument.
165-
split_before_first_argument=True
166-
167-
# Set to True to prefer splitting before 'and' or 'or' rather than
168-
# after.
169-
split_before_logical_operator=True
170-
171-
# Split named assignments onto individual lines.
172-
split_before_named_assigns=False
173-
174-
# Insert a blank line before a 'def' or 'class' immediately nested
175-
# within another 'def' or 'class'. For example:
176-
#
177-
# class Foo:
178-
# # <------ this blank line
179-
# def method():
180-
# ...
181-
blank_line_before_nested_class_or_def=True
182-
183-
# Set to True to split list comprehensions and generators that have
184-
# non-trivial expressions and multiple clauses before each of these
185-
# clauses. For example:
186-
#
187-
# result = [
188-
# a_long_var + 100 for a_long_var in xrange(1000)
189-
# if a_long_var % 10]
190-
#
191-
# would reformat to something like:
192-
#
193-
# result = [
194-
# a_long_var + 100
195-
# for a_long_var in xrange(1000)
196-
# if a_long_var % 10]
197-
split_complex_comprehension=True
198-
199-
# The penalty of splitting a list of "import as" names. For example:
200-
#
201-
# from a_very_long_or_indented_module_name_yada_yad import (long_argument_1,
202-
# long_argument_2,
203-
# long_argument_3)
204-
#
205-
# would reformat to something like:
206-
#
207-
# from a_very_long_or_indented_module_name_yada_yad import (
208-
# long_argument_1, long_argument_2, long_argument_3)
209-
## HANDLED BY `isort`
210-
split_penalty_import_names=10000
113+
use_parentheses=True

0 commit comments

Comments
 (0)