Skip to content

Commit ee5d31a

Browse files
committed
Fix style issues.
1 parent c3d62ae commit ee5d31a

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

jsonschema/validators.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,8 @@ def create(
152152
153153
format_checker (jsonschema.FormatChecker):
154154
155-
a format checker, used when applying the :validator:`format` validator.
155+
a format checker, used when applying the :validator:`format`
156+
validator.
156157
157158
If unprovided, a `jsonschema.FormatChecker` will be created
158159
with a set of default formats typical of JSON Schema drafts.
@@ -171,16 +172,16 @@ def create(
171172
172173
a new `jsonschema.protocols.Validator` class
173174
"""
174-
# rename to not clash with "format_checker" argument of `Validator.__init__()`
175-
fmt_checker = format_checker
175+
# preemptively don't shadow the `Validator.format_checker` local
176+
format_checker_arg = format_checker
176177

177178
@attr.s
178179
class Validator:
179180

180181
VALIDATORS = dict(validators)
181182
META_SCHEMA = dict(meta_schema)
182183
TYPE_CHECKER = type_checker
183-
FORMAT_CHECKER = fmt_checker
184+
FORMAT_CHECKER = format_checker_arg
184185
ID_OF = staticmethod(id_of)
185186

186187
schema = attr.ib(repr=reprlib.repr)
@@ -295,7 +296,13 @@ def is_valid(self, instance, _schema=None):
295296
return Validator
296297

297298

298-
def extend(validator, validators=(), version=None, type_checker=None, format_checker=None):
299+
def extend(
300+
validator,
301+
validators=(),
302+
version=None,
303+
type_checker=None,
304+
format_checker=None,
305+
):
299306
"""
300307
Create a new validator class by extending an existing one.
301308
@@ -335,7 +342,8 @@ def extend(validator, validators=(), version=None, type_checker=None, format_che
335342
336343
format_checker (jsonschema.FormatChecker):
337344
338-
a format checker, used when applying the :validator:`format` validator.
345+
a format checker, used when applying the :validator:`format`
346+
validator.
339347
340348
If unprovided, the format checker of the extended
341349
`jsonschema.protocols.Validator` will be carried along.

0 commit comments

Comments
 (0)