Skip to content

Commit 327b203

Browse files
committed
Switching to line length 120
1 parent ad33a4a commit 327b203

19 files changed

+278
-1021
lines changed

.flake8

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[flake8]
2-
max_line_length = 88
2+
max_line_length = 120
33
show_source = true
44
exclude = .git,.venv,.venv2,.venv3,__pycache__,.cache
55

@@ -12,8 +12,6 @@ exclude = .git,.venv,.venv2,.venv3,__pycache__,.cache
1212
# ref:
1313
# https://pycodestyle.readthedocs.io/en/latest/intro.html#error-codes
1414
#
15-
# The ignored E501 is intended to be _temporary_ and should be removed once all
16-
# of the long lines can be addressed.
17-
extend_ignore = E203,E231,E302,E501
15+
extend_ignore = E203,E231,E302
1816

1917
# vim:filetype=dosini

mock_connect/mock_connect/http_helpers.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,7 @@ def _make_json_ready(thing):
4343

4444

4545
def endpoint(
46-
authenticated: bool = False,
47-
auth_optional: bool = False,
48-
cls=None,
49-
writes_json: bool = False,
46+
authenticated: bool = False, auth_optional: bool = False, cls=None, writes_json: bool = False,
5047
):
5148
def decorator(function):
5249
@wraps(function)
@@ -69,9 +66,7 @@ def wrapper(object_id=None, *args, **kwargs):
6966
object_id = int(object_id)
7067
item = cls.get_object(object_id)
7168
if item is None:
72-
result = error(
73-
404, "%s with ID %s not found." % (cls.__name__, object_id)
74-
)
69+
result = error(404, "%s with ID %s not found." % (cls.__name__, object_id))
7570
else:
7671
result = _make_json_ready(function(item, *args, **kwargs))
7772

mock_connect/mock_connect/main.py

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -97,24 +97,18 @@ def upload(connect_app):
9797
def deploy(connect_app):
9898
bundle_id = request.get_json(force=True).get("bundle")
9999
if bundle_id is None:
100-
return error(
101-
400, "bundle_id is required"
102-
) # message and status code probably wrong
100+
return error(400, "bundle_id is required") # message and status code probably wrong
103101
bundle = Bundle.get_object(bundle_id)
104102
if bundle is None:
105-
return error(
106-
404, "bundle %s not found" % bundle_id
107-
) # message and status code probably wrong
103+
return error(404, "bundle %s not found" % bundle_id) # message and status code probably wrong
108104

109105
manifest = bundle.get_manifest()
110106
old_app_mode = connect_app.app_mode
111107
# noinspection SpellCheckingInspection
112108
new_app_mode = AppMode.value_of(manifest["metadata"]["appmode"])
113109

114110
if old_app_mode is not None and old_app_mode != new_app_mode:
115-
return error(
116-
400, "Cannot change app mode once deployed"
117-
) # message and status code probably wrong
111+
return error(400, "Cannot change app mode once deployed") # message and status code probably wrong
118112

119113
connect_app.bundle_deployed(bundle, new_app_mode)
120114

@@ -161,9 +155,7 @@ def python_settings():
161155
def content(connect_app):
162156
bundle = connect_app.get_bundle()
163157
if bundle is None:
164-
return error(
165-
400, "The content has not been deployed."
166-
) # message and status code probably wrong
158+
return error(400, "The content has not been deployed.") # message and status code probably wrong
167159
return bundle.get_rendered_content()
168160

169161

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[tool.black]
2+
line-length = 120
3+
target-version = ['py27', 'py35', 'py36', 'py37', 'py38']

0 commit comments

Comments
 (0)