Skip to content

Commit 1e352e8

Browse files
RomainTTRomain Taprest
authored andcommitted
[CLI] Add newline at end of oneline error
1 parent e1374db commit 1e352e8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

jsonschema/cli.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ class CliOutputWriter():
2424
"Failed to parse {file_name}. "
2525
"Got the following error: {exception}\n"
2626
)
27-
PLAIN_ERROR_MSG = "{error.instance}: {error.message}\n"
2827
PRETTY_ERROR_MSG = "===[ERROR]===({object_name})===\n{error}\n"
2928
PRETTY_SUCCESS_MSG = "===[SUCCESS]===({object_name})===\n"
3029

@@ -37,6 +36,8 @@ def __init__(
3736
):
3837
self.output_format = output_format
3938
self.oneline_format = oneline_format
39+
if not self.oneline_format.endswith("\n"):
40+
self.oneline_format += "\n"
4041
self.stdout = stdout
4142
self.stderr = stderr
4243

@@ -68,7 +69,7 @@ def write_valid_error(self, object_name, error_obj):
6869
error=error_obj,
6970
)
7071
elif self.output_format == "plain":
71-
msg = self.PLAIN_ERROR_MSG.format(
72+
msg = self.oneline_format.format(
7273
object_name=object_name,
7374
error=error_obj,
7475
)

0 commit comments

Comments
 (0)