Skip to content

Commit 3dea76f

Browse files
committed
Use textwrap.dedent in quoted_output
1 parent c90fc06 commit 3dea76f

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

tagging/utils/quoted_output.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Copyright (c) Jupyter Development Team.
22
# Distributed under the terms of the Modified BSD License.
3+
import textwrap
4+
35
from docker.models.containers import Container
46

57
from tagging.utils.docker_runner import DockerRunner
@@ -14,9 +16,11 @@ def quoted_output(container: Container, cmd: str) -> str:
1416

1517
assert cmd_output, f"Command `{cmd}` returned empty output"
1618

17-
return f"""\
18-
`{cmd}`:
19+
return textwrap.dedent(
20+
f"""\
21+
`{cmd}`:
1922
20-
```text
21-
{cmd_output}
22-
```"""
23+
```text
24+
{{output}}
25+
```"""
26+
).format(output=cmd_output)

0 commit comments

Comments
 (0)