diff options
author | Julian Berman <Julian@GrayVines.com> | 2021-08-04 10:29:44 +0100 |
---|---|---|
committer | Julian Berman <Julian@GrayVines.com> | 2021-08-04 10:29:44 +0100 |
commit | e908b8055596329f0b4ba1bc0dc1c793b437299f (patch) | |
tree | cb2bb0a41b6b8b8b26715e17bcdc944a676e29a1 /jsonschema/_legacy_validators.py | |
parent | 39697cda809169cf7031839bb0174b5d8136029e (diff) | |
download | jsonschema-draft2020-12.tar.gz |
Fix missing trailing commas.draft2020-12
Add flake8-commas to ensure this stays the case.
Diffstat (limited to 'jsonschema/_legacy_validators.py')
-rw-r--r-- | jsonschema/_legacy_validators.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/jsonschema/_legacy_validators.py b/jsonschema/_legacy_validators.py index 7cb6df9..63adf49 100644 --- a/jsonschema/_legacy_validators.py +++ b/jsonschema/_legacy_validators.py @@ -32,9 +32,8 @@ def dependencies_draft3(validator, dependencies, instance, schema): yield error elif validator.is_type(dependency, "string"): if dependency not in instance: - yield ValidationError( - "%r is a dependency of %r" % (dependency, property) - ) + message = "%r is a dependency of %r" + yield ValidationError(message % (dependency, property)) else: for each in dependency: if each not in instance: @@ -77,7 +76,7 @@ def disallow_draft3(validator, disallow, instance, schema): for disallowed in _utils.ensure_list(disallow): if validator.is_valid(instance, {"type": [disallowed]}): yield ValidationError( - "%r is disallowed for %r" % (disallowed, instance) + "%r is disallowed for %r" % (disallowed, instance), ) @@ -136,7 +135,7 @@ def minimum_draft3_draft4(validator, minimum, instance, schema): if failed: yield ValidationError( - "%r is %s the minimum of %r" % (instance, cmp, minimum) + "%r is %s the minimum of %r" % (instance, cmp, minimum), ) @@ -153,7 +152,7 @@ def maximum_draft3_draft4(validator, maximum, instance, schema): if failed: yield ValidationError( - "%r is %s the maximum of %r" % (instance, cmp, maximum) + "%r is %s the maximum of %r" % (instance, cmp, maximum), ) @@ -208,5 +207,5 @@ def contains_draft6_draft7(validator, contains, instance, schema): if not any(validator.is_valid(element, contains) for element in instance): yield ValidationError( - "None of %r are valid under the given schema" % (instance,) + "None of %r are valid under the given schema" % (instance,), ) |