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: global linesep character, handle diffs #50

Merged
merged 2 commits into from Sep 22, 2022

Conversation

braydonk
Copy link
Collaborator

Closes #48

Using the new multilinediff there needed to be two changes made:

  • Needed to handle diffs using the count of differences found, since the new reporter always reports something
  • Needed to recongize a line separation character at the engine level

This PR fixes the diff handling, which was relatively trivial. However, an oversight since the beginning is that diffs never took into account the line ending being used, and assumed \n. This needed to be rectified, and lead to something of a re-architecture that adds line_ending as a setting that acts as a global override. This required simplifying the Factory interface a little bit, in a way that sort of simplifies it. While refactoring anyway, I also decided to simplify the line break logic, so I didn't have to repeat the same constant check everywhere.

Using the new `multilinediff` there needed to be two changes made:
* Needed to handle diffs using the count of differences found, since the
  new reporter always reports something
* Needed to recongize a line separation character at the engine level

This PR fixes the diff handling, which was relatively trivial. However,
an oversight since the beginning is that diffs never took into account
the line ending being used, and assumed `\n`. This needed to be
rectified, and lead to something of a re-architecture that adds
`line_ending` as a setting that acts as a global override. This required
simplifying the `Factory` interface a little bit, in a way that sort of
simplifies it. While refactoring anyway, I also decided to simplify the
line break logic, so I didn't have to repeat the same constant check
everywhere.
The PR removed CRLF line ending feature by accident. Also found a bug in
emoji support where it fails when the yaml file is empty.
@braydonk braydonk merged commit f0be560 into google:main Sep 22, 2022
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.

-lint always fails
1 participant