Skip to content

Commit

Permalink
Avoid whitespace in json output
Browse files Browse the repository at this point in the history
This makes it possible to skip an extra jq step in Github actions
  • Loading branch information
berland committed Jan 18, 2023
1 parent f428391 commit b5636b9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion komodo/deployed.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down
2 changes: 1 addition & 1 deletion tests/test_non_deployed.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit b5636b9

Please sign in to comment.