From bd92eb372fce6280cf2378b3d94a958a52b2c284 Mon Sep 17 00:00:00 2001 From: Frost Ming Date: Fri, 6 Nov 2020 11:22:12 +0800 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Tzu-ping Chung --- pipenv/cli/command.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pipenv/cli/command.py b/pipenv/cli/command.py index 01612717..ae5644f4 100644 --- a/pipenv/cli/command.py +++ b/pipenv/cli/command.py @@ -730,12 +730,12 @@ def scripts(): echo("No Pipfile present at project home.", err=True) sys.exit(1) scripts = project.parsed_pipfile.get('scripts', {}) - first_column_width = max(len(word) for word in ["Command"] + list(scripts.keys())) + first_column_width = max(len(word) for word in ["Command"] + list(scripts)) second_column_width = max(len(word) for word in ["Script"] + list(scripts.values())) - lines = ["{} Script".format("Command".ljust(first_column_width))] + lines = ["{0:<{width}} Script".format("Command", width=first_column_width)] lines.append("{} {}".format("-" * first_column_width, "-" * second_column_width)) lines.extend( - "{} {}".format(name.ljust(first_column_width), script) + "{0:<{width}} {1}".format(name, script, width=first_column_width) for name, script in scripts.items() ) echo(os.linesep.join(fix_utf8(line) for line in lines))