Skip to content

Replaced textwrap package with custom implementation #3933

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

Merged
merged 1 commit into from
Dec 2, 2024

Conversation

ross-byrne
Copy link
Contributor

Resolves: #2850

Removes textwrap package in favour of custom implementation.

Personally, I'm not convinced this is better than just using textwrap and removing the terminal width check:

textwrap::fill(text, 75)

Issues

There are some slight differences in output between this solution and textwrap's more sophisticated solution. This has caused some minor differences with some of the snapshots. I've reviewed and updated them but I want to draw attention to it.

Question: are we OK with these differences?

@lpil
Copy link
Member

lpil commented Dec 2, 2024

Personally, I'm not convinced this is better than just using textwrap and removing the terminal width check:

The motivation was that it had previously caused build failures, so we want to remove it and simplify the dependency tree. Code is cheaper than dependencies.

@ross-byrne
Copy link
Contributor Author

The motivation was that it had previously caused build failures

Totally fair, that's good context to have thanks.

Copy link
Member

@lpil lpil left a comment

Choose a reason for hiding this comment

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

Thank you!!!

@lpil lpil merged commit 0b2cf1b into gleam-lang:main Dec 2, 2024
12 checks passed
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.

Replace textwrap library with a custom wrap function with a fixed maximum
2 participants