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

[Feature request] Add support for editorconfig-defined newline separator characters #1231

Closed
4 of 6 tasks
baronfel opened this issue Nov 8, 2020 · 3 comments · Fixed by #1242
Closed
4 of 6 tasks

Comments

@baronfel
Copy link
Contributor

baronfel commented Nov 8, 2020

I propose we add support for the end_of_line setting in editorconfig, which is a core setting that allows a user to select the newline character to use in their code, centralizing that in one location.

The existing way Fantomas deals with this problem is to assume the value of Environment.Newline for using newlines, which does not work when the user selects to use \n everywhere in their editorconfig but writes code on Windows, for example.

Pros and Cons

The advantages of making this adjustment to Fantomas are more unification with other tools that embed line-ending information in editorconfig files.

The disadvantages of making this adjustment to Fantomas are slightly increased code complexity, because the chosen newline configuration would need to be threaded through the codebase wherever it was needed.

Examples

Please provide multiple examples (before and after scenarios) and explain what rules did apply to achieve the outcome.

Extra information

Estimated cost (XS, S, M, L, XL, XXL): M

Related suggestions: (put links to related suggestions here)

Affidavit (please submit!)

Please tick this by placing a cross in the box:

Please tick all that apply:

  • This is not a breaking change to Fantomas
  • I or my company would be willing to help implement and/or test this
  • This suggestion is part of the Microsoft style guide (please add a link to section if so)
  • This suggestion is part of the G-Research style guide (please add a link to section if so)
@nojaf
Copy link
Contributor

nojaf commented Nov 8, 2020

Approved.

@kodfodrasz
Copy link

Hey!

I was having the need for the same thing a few days ago. I'm willing to help. (But would need some guidance in getting started)

@nojaf
Copy link
Contributor

nojaf commented Nov 9, 2020

Hey @kodfodrasz, @baronfel and I will pick this up in the next Fantomas & Friends session this Wednesday. See #1206

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 a pull request may close this issue.

3 participants