-
Notifications
You must be signed in to change notification settings - Fork 53
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
editorconfig: Remove unnecessary rules #436
base: master
Are you sure you want to change the base?
Conversation
None of these rules are needed for Visual Studio and these also do not stem from any defaults/templates of VS.
# Xml project files | ||
[*.{config,csproj,njsproj,targets,vcxitems,vcxproj,vcxproj.filters}] | ||
indent_size = 2 | ||
end_of_line = crlf | ||
insert_final_newline = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd say we should leave insert_final_newline = false in. These are specific VS formats. VS never adds final new lines and removes them when found. It is safe and reasonable to leave this setting in the editorconfig, so other code editors won't accidentially insert final new lines when it is their default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
VS never adds final new lines and removes them when found
I don't see VS removing final new lines.
It is safe and reasonable to leave this setting in the editorconfig, so other code editors won't accidentially insert final new lines when it is their default
The right way to achieve this would be
insert_final_newline = unset
The problem with insert_final_newline is that some editors interpret it as instruction to remove a final newline. Setting it to false sounds like telling the editor to do nothing, but that's not always the result you get. The right way to have an editor do nothing wrt some rule is its absense. This is what unset achieves.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
VS never adds final new lines and removes them when found
I don't see VS removing final new lines.
I guess what you mean is when making changes in the project designer in old-style (non-SDK) project, where the project desginer writes it out like this.
When you edit a csproj file for text editing (which is the same as what people with other editors would be doing), VS doesn't remove final line breaks.
For SDK style projects, it doesn't even do this when making changes with the project designer.
|
||
# XML config files | ||
[*.{msbuild,props,targets,ruleset,config,nuspec}] | ||
indent_size = 2 | ||
end_of_line = crlf | ||
insert_final_newline = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd say we should leave insert_final_newline = false in. These are specific VS formats. VS never adds final new lines and removes them when found. It is safe and reasonable to leave this setting in the editorconfig, so other code editors won't accidentially insert final new lines when it is their default.
None of these rules are needed for Visual Studio and these also do not stem from any defaults/templates of VS.
Resubmission of #433