Nerdbank.gitversioning: Consider using EditorConfigs `insert_final_newline` when generating new version.json with nbgv

Created on 19 Dec 2019  路  5Comments  路  Source: dotnet/Nerdbank.GitVersioning

It would be cool, if nbgv set-version would respect insert_final_newline = true. 馃槈

help wanted

Most helpful comment

@yannduran for me, it's because of the scc diffs that show up later. I like trailing newlines so that adding another line doesn't have to _change_ the last line as well as add the new one. I just want to add the new one.

That's also why I add trailing commas to lists where each item is on its own line.

All 5 comments

Yes, and tabs vs. Spaces and indent size too.
Any idea of a library that would help with adding such a feature?

As someone who HATES empty lines at the end of a file in my own code, can I ask you guys why you feel one is necessary (not specifically here, just in general)?

That's a good explanation why I want it too:
https://stackoverflow.com/a/729795

In short: Because of the POSIX standard

@yannduran for me, it's because of the scc diffs that show up later. I like trailing newlines so that adding another line doesn't have to _change_ the last line as well as add the new one. I just want to add the new one.

That's also why I add trailing commas to lists where each item is on its own line.

@AArnott thanks for that explanation! Makes sense from a source control point of view.

I have to admit, I do add a new line for files that I know might have something added after the current last line (mainly for making copy/pasting another line easier), but for files containing things like classes, enums, interfaces etc that will never have anything added after the final } I religiously get rid of them.

Just a personal quirk I guess.

I've seen people having a trailing command for things. I didn't even think that'd be legal code, but it still compiles.

Was this page helpful?
0 / 5 - 0 ratings