feat(editorconfig): add support for insert_final_newline - #1764
Conversation
1bb7dad to
06dae66
Compare
|
CSharpier is not going to support this option. You are welcome to fork it if you can't convince your organization to change. |
|
I'm disappointed, but thanks for reviewing! Also thanks for Csharpier. It is an incredibly useful tool! |
| } | ||
|
|
||
| return "\n"; | ||
| var fileHasClrfEnding = code.Contains("\r\n"); |
There was a problem hiding this comment.
I believe the reason the old code is the way it is - this version is cleaner, but in a case with a file that does not have \r\n this will search the entire file. The current version of the code should only search the first line of text.
|
Thanks for being understanding! I was going to adopt the one change I commented on just now but then realized why the code is the way it is. |
May I please ask why? I'm honestly curious and don't want to miss a learning opportunity. Just to recap If I correctly understand the intent of the PR, the author would like CSharpier to support the following [*.xml]
insert_final_newline = falseIf I correctly understand the above quoted response, CSharpier is not going to support the above option. Questions
Thanks |
|
CSharpier ends all files with a single new line. It is a standard practice - https://www.google.com/search?q=why+should+I+end+a+file+with+one+new+line CSharpier will not add any options beyond the few that it already has. If someone doesn't like the way it does things they are welcome to fork it or not use it. |
Currently
csharpierinsists in always adding a new line.I found that there are existing issues that have been closed regarding this:
Currently this causes a bit of problems in my workflow. The organization I work for sets
.editorconfigwithinsert_final_newlineset to false. This causes my PRs to often fail when linting is run, asdotnet formatrespects the.editorconfigfile, and since the files have newlines,dotnet format --verify-no-changesfails.I personally agree that we should have newlines, but I'm not in a position to change how the orginization I work for sets their configurations.