Skip to content

Commit

Permalink
update for feedback, fix off-by-one when used with -l
Browse files Browse the repository at this point in the history
  • Loading branch information
tgolsson committed May 10, 2022
1 parent abc06c7 commit 6d19084
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/poetry/console/commands/show.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ def handle(self) -> int | None:
required_by = reverse_deps(locked, locked_repo)
required_by_length = max(
required_by_length,
len("via " + ",".join(required_by.keys())),
len(" from " + ",".join(required_by.keys())),
)
else:
name_length = max(name_length, current_length)
Expand All @@ -288,14 +288,12 @@ def handle(self) -> int | None:

write_version = name_length + version_length + 3 <= width
write_latest = name_length + version_length + latest_length + 3 <= width
write_why = self.option("why") and (
name_length + version_length + latest_length + required_by_length + 3
<= width
)
write_description = (
name_length + version_length + latest_length + required_by_length + 24
<= width

why_end_column = (
name_length + version_length + latest_length + required_by_length
)
write_why = self.option("why") and (why_end_column + 3) <= width
write_description = (why_end_column + 24) <= width

for locked in locked_packages:
color = "cyan"
Expand Down

0 comments on commit 6d19084

Please sign in to comment.