Skip to content

Commit

Permalink
feat(cli): unified the display format of description in CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
yeyong.yu committed Jul 14, 2021
1 parent 1ca8515 commit 802336a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions tensorbay/cli/draft.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ def _echo_draft(
title = "<no title>"
click.echo(f"\n {title}\n")
if description:
description = description.replace("\n", "\n ")
click.echo(f" {description}\n")


Expand Down
11 changes: 7 additions & 4 deletions tensorbay/cli/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
{}
{}
"""


Expand All @@ -45,10 +43,15 @@ def _get_oneline_log(commit: Commit) -> str:


def _get_full_log(commit: Commit) -> str:
return _FULL_LOG.format(
semi_log = _FULL_LOG.format(
commit.commit_id,
commit.committer.name,
datetime.fromtimestamp(commit.committer.date).strftime("%a %b %d %H:%M:%S %y"),
commit.title,
commit.description,
)
description = commit.description
if description:
description = description.replace("\n", "\n ")
log_tuple = (semi_log, " ", description, "\n")
return "".join(log_tuple)
return semi_log

0 comments on commit 802336a

Please sign in to comment.