Skip to content

Commit edba224

Browse files
committed
Standardize the format of Raises: in napolean docstrings.
Sphinx appears to 'helpfully' silently truncate the line if any text is put on the same line as the exception, i.e.: Raises: foo, if bar just silently produces: foo - and throws the line away...
1 parent 28a8666 commit edba224

File tree

4 files changed

+14
-10
lines changed

4 files changed

+14
-10
lines changed

jsonschema/_format.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,11 @@ def check(self, instance: object, format: str) -> None:
105105
106106
The format that instance should conform to
107107
108-
109108
Raises:
110109
111-
FormatError: if the instance does not conform to ``format``
110+
FormatError:
111+
112+
if the instance does not conform to ``format``
112113
"""
113114

114115
if format not in self.checkers:

jsonschema/_types.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@ def is_type(self, instance, type):
112112
Raises:
113113
114114
`jsonschema.exceptions.UndefinedTypeCheck`:
115-
if type is unknown to this object.
115+
116+
if ``type`` is unknown to this object.
116117
"""
117118
try:
118119
fn = self._type_checkers[type]

jsonschema/protocols.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def check_schema(cls, schema: dict) -> None:
111111
112112
Raises:
113113
114-
`jsonschema.exceptions.SchemaError`
114+
`jsonschema.exceptions.SchemaError`:
115115
116116
if the schema is invalid
117117
"""
@@ -136,7 +136,7 @@ def is_type(self, instance: Any, type: str) -> bool:
136136
137137
Raises:
138138
139-
`jsonschema.exceptions.UnknownType`
139+
`jsonschema.exceptions.UnknownType`:
140140
141141
if ``type`` is not a known type
142142
"""
@@ -176,7 +176,7 @@ def validate(self, instance: Any) -> None:
176176
177177
Raises:
178178
179-
`jsonschema.exceptions.ValidationError`
179+
`jsonschema.exceptions.ValidationError`:
180180
181181
if the instance is invalid
182182

jsonschema/validators.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,11 +1076,13 @@ def validate(instance, schema, cls=None, *args, **kwargs):
10761076
10771077
Raises:
10781078
1079-
`jsonschema.exceptions.ValidationError` if the instance
1080-
is invalid
1079+
`jsonschema.exceptions.ValidationError`:
10811080
1082-
`jsonschema.exceptions.SchemaError` if the schema itself
1083-
is invalid
1081+
if the instance is invalid
1082+
1083+
`jsonschema.exceptions.SchemaError`:
1084+
1085+
if the schema itself is invalid
10841086
10851087
.. rubric:: Footnotes
10861088
.. [#] known by a validator registered with

0 commit comments

Comments
 (0)