-
-
Notifications
You must be signed in to change notification settings - Fork 240
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
fix alembic.util.messaging.msg to properly wrap at terminal width #1385
Conversation
Instead of applying indent manually after using textwrap, simply use the `textwrap.wrap`'s `initial_indent` / `subsequent_indent` that will taken into account when wrapping to the specified `width` Fixes: sqlalchemy#1384
Thanks, could you add a changelog file too? See https://github.com/sqlalchemy/alembic/tree/3452979f0d1fcd42f0a8311642f6ee4e70d6f95c/docs/build/unreleased for examples |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, this is sqla-tester setting up my work on behalf of CaselIT to try to get revision 3ce8e83 of this pull request into gerrit so we can run tests and reviews and stuff
New Gerrit review created for change 3ce8e83: https://gerrit.sqlalchemy.org/c/sqlalchemy/alembic/+/5082 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, this is sqla-tester setting up my work on behalf of CaselIT to try to get revision ff59fa5 of this pull request into gerrit so we can run tests and reviews and stuff
Patchset ff59fa5 added to existing Gerrit review https://gerrit.sqlalchemy.org/c/sqlalchemy/alembic/+/5082 |
Done! |
Michael Bayer (zzzeek) wrote: thank you! View this in Gerrit at https://gerrit.sqlalchemy.org/c/sqlalchemy/alembic/+/5082 |
Gerrit review https://gerrit.sqlalchemy.org/c/sqlalchemy/alembic/+/5082 has been merged. Congratulations! :) |
Description
Instead of applying indent manually after using textwrap, simply use the
textwrap.wrap
'sinitial_indent
/subsequent_indent
so that it is accounted for when wrapping towidth
.Otherwise, each line will actually exceed the terminal width by two characters, since we were prepending two spaces.
Fixes: #1384
Manual Testing
Running the repro in #1384 now produces the expected output:
Output:
🎉
Checklist
This pull request is:
must include a complete example of the issue. one line code fixes without an
issue and demonstration will not be accepted.
Fixes: #<issue number>
in the commit messageinclude a complete example of how the feature would look.
Fixes: #<issue number>
in the commit messageHave a nice day!