Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--no-truncate flag in show command #9580

Merged

Conversation

ch1nq
Copy link
Contributor

@ch1nq ch1nq commented Jul 25, 2024

Fixes #9597

In order to get a more consistent output from the poetry show command, this PR introduces a --no-truncate flag to the command. When the flag is set the show command does not take the width of the terminal into account when deciding the level of detail to print.

Pull Request Check List

  • Added tests for changed code.
  • Updated documentation for changed code.

Copy link
Member

@abn abn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just set width = math.inf if self.option("--no-truncate") else ...? simplifies the code changes a lot.

@abn
Copy link
Member

abn commented Jan 17, 2025

Also, you might need to re-do the cli doc changes, since we reodered that doc.

@abn
Copy link
Member

abn commented Jan 31, 2025

@ch1nq is this something you'd like to continue working on?

@ch1nq
Copy link
Contributor Author

ch1nq commented Feb 6, 2025

@ch1nq is this something you'd like to continue working on?

Thanks for the review - I will apply the suggested changes

@ch1nq ch1nq requested a review from abn February 6, 2025 11:04
@ch1nq
Copy link
Contributor Author

ch1nq commented Feb 7, 2025

@abn I have gone with sys.maxsize instead of math.inf, since we need it to be an int. This is because we use the value as a slice index later in the code.

docs/cli.md Outdated Show resolved Hide resolved
@ch1nq ch1nq requested a review from abn February 10, 2025 09:06
abn
abn previously approved these changes Feb 11, 2025
@radoering radoering force-pushed the disregard-terminal-width-in-show-command branch from 36b9e22 to ff790e6 Compare February 12, 2025 11:44
@radoering radoering force-pushed the disregard-terminal-width-in-show-command branch from ff790e6 to 0d4fc3a Compare February 12, 2025 11:44
@radoering radoering enabled auto-merge (squash) February 12, 2025 11:48
@radoering radoering merged commit 2d59bf6 into python-poetry:main Feb 12, 2025
54 checks passed
@radoering radoering mentioned this pull request Feb 14, 2025
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Get more consistent output from poetry show
3 participants