We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1254be0 commit 8304e41Copy full SHA for 8304e41
.pre-commit-config.yaml
@@ -5,7 +5,6 @@ repos:
5
rev: v4.4.0
6
hooks:
7
- id: check-ast
8
- - id: check-docstring-first
9
- id: check-json
10
- id: check-toml
11
- id: check-vcs-permalinks
jsonschema/exceptions.py
@@ -340,6 +340,15 @@ def relevance(error):
340
341
342
relevance = by_relevance()
343
+"""
344
+A key function (e.g. to use with `sorted`) which sorts errors by relevance.
345
+
346
+Example:
347
348
+.. code:: python
349
350
+ sorted(validator.iter_errors(12), key=jsonschema.exceptions.relevance)
351
352
353
354
def best_match(errors, key=relevance):
0 commit comments