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

Simplify whitespace trimming #48

Merged
merged 2 commits into from
Jun 4, 2024

Conversation

ltratt
Copy link
Member

@ltratt ltratt commented Jun 3, 2024

The main part of this PR is in 98e3fce. Hopefully the commit message explains what it's doing well! ab150bf is a tidy-up after the fact.

Notice that this PR is a breaking change: but, arguably, ..~ was also a breaking change, so we've probably got a "two breaking changes for the price of one release" situation, which could be worse.

@vext01
Copy link
Member

vext01 commented Jun 4, 2024

Perfect. Thanks! Please squash.

fm previously had three whitespace options: ignore_leading_whitespace,
ignore_trailing_whitespace, ignore_surrounding_blank_lines. I
implemented those and each time I had to read the documentation three
times to work out which was which. Even worse, the *trailing* whitespace
search didn't quite work correctly.

This commit radically simplifies things:

  1. There is now one option for "trimming whitespace". In its default
     option, it "does what most people want (TM)". Anyone who sets it to
     false will presumably be willing to be very careful in the tests
     they write.

  2. This allows the main searching loop to be substantially simplified.

So, in summary this commit: is more correct than before and simpler than
before. It does break backwards compatibility, but for a set of options
that I doubt anyone actually used much, if at all.
This has become so voluminous that, in the main matching loop, it's
distracting.
@ltratt ltratt force-pushed the simplify_whitespace_trimming branch from 2244c60 to 7550a0f Compare June 4, 2024 08:31
@ltratt
Copy link
Member Author

ltratt commented Jun 4, 2024

Squashed.

@vext01 vext01 added this pull request to the merge queue Jun 4, 2024
Merged via the queue into softdevteam:master with commit 5da2577 Jun 4, 2024
2 checks passed
@ltratt ltratt deleted the simplify_whitespace_trimming branch August 30, 2024 07:54
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