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

feat(cli): set max terminal width based on terminal #817

Merged
merged 1 commit into from
Aug 25, 2024

Conversation

mkniewallner
Copy link
Collaborator

PR Checklist

  • A description of the changes is added to the description of this PR.
  • If there is a related issue, make sure it is linked to this PR.
  • If you've fixed a bug or added code that should be tested, add tests!
  • If you've added or modified a feature, documentation in docs is updated

Description of changes

By default, click wraps lines at 80 characters. This makes the command descriptions in help command hard to read properly IMO:

Screenshot from 2024-08-11 01-28-14

Per the documentation, there is a way to change that. Using shutil.get_terminal_size should be a sensible choice, as it will first check if the terminal provides the right information, then the OS if not, then fallback to a default 80 value (which is already what we have) if neither do.

On a full-size terminal, with a 1920x1080 screen resolution, this looks like this:

Screenshot from 2024-08-11 01-28-48

Copy link

codecov bot commented Aug 10, 2024

Codecov Report

Attention: Patch coverage is 60.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 92.3%. Comparing base (ce87735) to head (e3c1703).
Report is 1 commits behind head on main.

Files Patch % Lines
python/deptry/cli.py 60.0% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            main    #817     +/-   ##
=======================================
- Coverage   92.5%   92.3%   -0.2%     
=======================================
  Files         36      36             
  Lines        961     965      +4     
  Branches     173     173             
=======================================
+ Hits         889     891      +2     
- Misses        56      58      +2     
  Partials      16      16             

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mkniewallner mkniewallner marked this pull request as ready for review August 10, 2024 23:50
@mkniewallner mkniewallner added this to the 0.20 milestone Aug 10, 2024
@mkniewallner mkniewallner enabled auto-merge (squash) August 25, 2024 15:36
@mkniewallner mkniewallner merged commit 4e82f7a into main Aug 25, 2024
24 of 25 checks passed
@mkniewallner mkniewallner deleted the feat/dynamic-max-width branch August 25, 2024 15:51
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.

2 participants