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

Support user-provided end-of-line characters #1242

Merged
merged 11 commits into from
Nov 16, 2020

Conversation

baronfel
Copy link
Contributor

@baronfel baronfel commented Nov 11, 2020

This PR implements:

  • A new configuration setting for the user-supplied end_of_line setting
  • Parsing for this setting
  • Tests around the parsing
  • Use of this setting to generate newlines

There are currently some bugs in the replacement of newlines, specifically around adding newlines on single-line code samples, and we have questions about the use of the removeTrailingSpaces function, specifically if its functionality could be rolled into a more direct manipulation of the WriterModel.

@nojaf nojaf linked an issue Nov 13, 2020 that may be closed by this pull request
6 tasks
@nojaf
Copy link
Contributor

nojaf commented Nov 16, 2020

@baronfel I finished the implementation.
One thing though:
--check flag should not consider the line endings as a change (see #1196)
But formatting with a file with \r\n using setting lf should write the changed file to disk, so that is why I had some changed to the FAKEHelpers.

@baronfel baronfel marked this pull request as ready for review November 16, 2020 17:34
@nojaf nojaf merged commit 83ac83b into fsprojects:master Nov 16, 2020
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.

[Feature request] Add support for editorconfig-defined newline separator characters
2 participants