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

Prevent wrapping file locations containing white space #1120

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

tomasr8
Copy link
Member

@tomasr8 tomasr8 commented Aug 18, 2024

Closes #1078
Depends on #1105 (To see only the changes in this PR, look at the last two commits)

Since #1105 wraps file names containing white space in special unicode markers, we look out for them when
wrapping comments.

The fix overrides the _split method of TextWrapper where we manually generate the indivisible chunks, taking into
account enclosed file names.

I test the the wrapping behavior with gettext 0.22.5 (which includes the enclosing logic) to make sure it's consistent

@tomasr8
Copy link
Member Author

tomasr8 commented Aug 18, 2024

Interesting, calling super() inside a list comprehension does not work on python 3.9..

Copy link

codecov bot commented Aug 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.28%. Comparing base (f91754b) to head (6c21d2f).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1120      +/-   ##
==========================================
+ Coverage   91.26%   91.28%   +0.02%     
==========================================
  Files          27       27              
  Lines        4602     4613      +11     
==========================================
+ Hits         4200     4211      +11     
  Misses        402      402              
Flag Coverage Δ
macos-12-3.10 90.09% <100.00%> (+0.02%) ⬆️
macos-12-3.11 90.02% <100.00%> (+0.02%) ⬆️
macos-12-3.12 90.20% <100.00%> (+0.02%) ⬆️
macos-12-3.13-dev 89.72% <100.00%> (+0.02%) ⬆️
macos-12-3.8 90.02% <100.00%> (+0.02%) ⬆️
macos-12-3.9 90.02% <100.00%> (+0.02%) ⬆️
macos-12-pypy3.10 90.09% <100.00%> (+0.02%) ⬆️
ubuntu-22.04-3.10 90.11% <100.00%> (+0.02%) ⬆️
ubuntu-22.04-3.11 90.04% <100.00%> (+0.02%) ⬆️
ubuntu-22.04-3.12 90.22% <100.00%> (+0.02%) ⬆️
ubuntu-22.04-3.13-dev 89.74% <100.00%> (+0.02%) ⬆️
ubuntu-22.04-3.8 90.04% <100.00%> (+0.02%) ⬆️
ubuntu-22.04-3.9 90.04% <100.00%> (+0.02%) ⬆️
ubuntu-22.04-pypy3.10 90.11% <100.00%> (+0.02%) ⬆️
windows-2022-3.10 90.23% <100.00%> (+0.02%) ⬆️
windows-2022-3.11 90.16% <100.00%> (+0.02%) ⬆️
windows-2022-3.12 90.34% <100.00%> (+0.02%) ⬆️
windows-2022-3.13-dev 89.86% <100.00%> (+0.02%) ⬆️
windows-2022-3.8 90.16% <100.00%> (+0.02%) ⬆️
windows-2022-3.9 90.16% <100.00%> (+0.02%) ⬆️
windows-2022-pypy3.10 90.23% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@tomasr8 tomasr8 changed the title Prevent wrapping file locations containing white sapce Prevent wrapping file locations containing white space Aug 18, 2024
@akx
Copy link
Member

akx commented Sep 4, 2024

@tomasr8 Can you rebase now that #1105 was merged? Thanks!

@tomasr8
Copy link
Member Author

tomasr8 commented Sep 4, 2024

@tomasr8 Can you rebase now that #1105 was merged? Thanks!

Done ;)

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.

Long path with space lead to wrong PO file.
2 participants