From b5636b9ae80aac58502e86be070ff44f99932536 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5vard=20Berland?= Date: Wed, 18 Jan 2023 12:53:52 +0100 Subject: [PATCH] Avoid whitespace in json output This makes it possible to skip an extra jq step in Github actions --- komodo/deployed.py | 2 +- tests/test_non_deployed.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/komodo/deployed.py b/komodo/deployed.py index dbded43b7..538df2cb9 100644 --- a/komodo/deployed.py +++ b/komodo/deployed.py @@ -40,7 +40,7 @@ def fetch_non_deployed( def output_formatter(release_list: List[str], do_json: bool = False) -> str: if do_json: - return json.dumps(release_list) + return json.dumps(release_list, separators=(",", ":")) return "\n".join(release_list) diff --git a/tests/test_non_deployed.py b/tests/test_non_deployed.py index 8167cc8a8..c52fad237 100644 --- a/tests/test_non_deployed.py +++ b/tests/test_non_deployed.py @@ -85,7 +85,7 @@ def test_links_ignored(tmpdir): (["a"], False, "a"), (["a"], True, '["a"]'), (["a", "b"], False, "a\nb"), - (["a", "b"], True, '["a", "b"]'), + (["a", "b"], True, '["a","b"]'), ], ) def test_output_formatter(release_list, do_json, expected):