Skip to content

Commit 6f9200e

Browse files
authored
Merge pull request #180 from p1c2u/fix/flake-check-fixes
Flake8 check fixes
2 parents 4b712cb + 7360fca commit 6f9200e

File tree

15 files changed

+65
-39
lines changed

15 files changed

+65
-39
lines changed

openapi_core/contrib/flask/responses.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
"""OpenAPI core contrib flask responses module"""
2-
import re
3-
42
from openapi_core.validation.response.datatypes import OpenAPIResponse
53

64

openapi_core/schema/content/exceptions.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ class MimeTypeNotFound(OpenAPIContentError):
1313
availableMimetypes = attr.ib()
1414

1515
def __str__(self):
16-
return "Mimetype not found: {0}. Valid mimetypes: {1}".format(self.mimetype, self.availableMimetypes)
16+
return "Mimetype not found: {0}. Valid mimetypes: {1}".format(
17+
self.mimetype, self.availableMimetypes)

openapi_core/schema/media_types/exceptions.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,5 @@ class InvalidContentType(OpenAPIMediaTypeError):
2020
mimetype = attr.ib()
2121

2222
def __str__(self):
23-
return "Content for following mimetype not found: {0}".format(self.mimetype)
23+
return "Content for following mimetype not found: {0}".format(
24+
self.mimetype)

openapi_core/schema/media_types/models.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ def unmarshal(self, value, custom_formatters=None, resolver=None):
5858
raise InvalidMediaTypeValue(exc)
5959

6060
try:
61-
return self.schema.unmarshal(value, custom_formatters=custom_formatters)
61+
return self.schema.unmarshal(
62+
value, custom_formatters=custom_formatters)
6263
except UnmarshalError as exc:
6364
raise InvalidMediaTypeValue(exc)

openapi_core/schema/parameters/exceptions.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ class MissingParameter(MissingParameterError):
1717
name = attr.ib()
1818

1919
def __str__(self):
20-
return "Missing parameter (without default value): {0}".format(self.name)
20+
return "Missing parameter (without default value): {0}".format(
21+
self.name)
2122

2223

2324
@attr.s(hash=True)
@@ -42,4 +43,5 @@ class InvalidParameterValue(OpenAPIParameterError):
4243
original_exception = attr.ib()
4344

4445
def __str__(self):
45-
return "Invalid parameter value for `{0}`: {1}".format(self.name, self.original_exception)
46+
return "Invalid parameter value for `{0}`: {1}".format(
47+
self.name, self.original_exception)

openapi_core/schema/responses/exceptions.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ class InvalidResponse(OpenAPIResponseError):
1313
responses = attr.ib()
1414

1515
def __str__(self):
16-
return "Unknown response http status: {0}".format(str(self.http_status))
16+
return "Unknown response http status: {0}".format(
17+
str(self.http_status))
1718

1819

1920
@attr.s(hash=True)

openapi_core/schema/schemas/_format.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,10 @@ def is_datetime(instance):
8282
return False
8383
if not isinstance(instance, text_type):
8484
return True
85-
85+
8686
if DATETIME_HAS_STRICT_RFC3339:
8787
return strict_rfc3339.validate_rfc3339(instance)
88-
88+
8989
if DATETIME_HAS_ISODATE:
9090
return isodate.parse_datetime(instance)
9191

openapi_core/schema/schemas/_types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from jsonschema._types import (
2-
TypeChecker, is_any, is_array, is_bool, is_integer,
2+
TypeChecker, is_array, is_bool, is_integer,
33
is_object, is_number,
44
)
55
from six import text_type, binary_type

openapi_core/schema/schemas/exceptions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def __str__(self):
101101
class UnmarshallerStrictTypeError(UnmarshallerError):
102102
value = attr.ib()
103103
types = attr.ib()
104-
104+
105105
def __str__(self):
106106
types = ', '.join(list(map(str, self.types)))
107107
return "Value {value} is not one of types: {types}".format(

openapi_core/schema/schemas/factories.py

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,20 +100,38 @@ class SchemaDictFactory(object):
100100
Contribution('required', dest_default=[]),
101101
Contribution('default'),
102102
Contribution('nullable', dest_default=False),
103-
Contribution('all_of', dest_prop_name='allOf', is_list=True, dest_default=[]),
104-
Contribution('one_of', dest_prop_name='oneOf', is_list=True, dest_default=[]),
105-
Contribution('additional_properties', dest_prop_name='additionalProperties', dest_default=True),
103+
Contribution(
104+
'all_of',
105+
dest_prop_name='allOf', is_list=True, dest_default=[],
106+
),
107+
Contribution(
108+
'one_of',
109+
dest_prop_name='oneOf', is_list=True, dest_default=[],
110+
),
111+
Contribution(
112+
'additional_properties',
113+
dest_prop_name='additionalProperties', dest_default=True,
114+
),
106115
Contribution('min_items', dest_prop_name='minItems'),
107116
Contribution('max_items', dest_prop_name='maxItems'),
108117
Contribution('min_length', dest_prop_name='minLength'),
109118
Contribution('max_length', dest_prop_name='maxLength'),
110119
Contribution('pattern', src_prop_attr='pattern'),
111-
Contribution('unique_items', dest_prop_name='uniqueItems', dest_default=False),
120+
Contribution(
121+
'unique_items',
122+
dest_prop_name='uniqueItems', dest_default=False,
123+
),
112124
Contribution('minimum'),
113125
Contribution('maximum'),
114126
Contribution('multiple_of', dest_prop_name='multipleOf'),
115-
Contribution('exclusive_minimum', dest_prop_name='exclusiveMinimum', dest_default=False),
116-
Contribution('exclusive_maximum', dest_prop_name='exclusiveMaximum', dest_default=False),
127+
Contribution(
128+
'exclusive_minimum',
129+
dest_prop_name='exclusiveMinimum', dest_default=False,
130+
),
131+
Contribution(
132+
'exclusive_maximum',
133+
dest_prop_name='exclusiveMaximum', dest_default=False,
134+
),
117135
Contribution('min_properties', dest_prop_name='minProperties'),
118136
Contribution('max_properties', dest_prop_name='maxProperties'),
119137
)

0 commit comments

Comments
 (0)