space-wizards / space-station-14

A multiplayer game about paranoia and chaos on a space station. Remake of the cult-classic Space Station 13.
https://spacestation14.io
MIT License
2.62k stars 3.27k forks source link

Additional .editorconfig settings #27611

Open ShadowCommander opened 5 months ago

ShadowCommander commented 5 months ago

Description

We're getting a few inconsistencies around formatting in PRs recently, so it'd be best to write them into the .editorconfig and put them in the conventions doc.

Discuss which settings should be added and what values they should be set to. The values shown are either the current default values in the Rider IDE or the commented out value inside the current .editorconfig.

YAML

These ones are additional Resharper configs that are not currently defined in our .editorconfig, but are default in Rider.

resharper_braces_for_while = required
resharper_csharp_insert_final_newline = true
resharper_csharp_keep_existing_enum_arrangement = false
resharper_csharp_wrap_before_binary_opsign = true
resharper_csharp_wrap_parameters_style = chop_if_long
resharper_indent_raw_literal_string = indent
resharper_keep_existing_declaration_block_arrangement = false
resharper_keep_existing_embedded_block_arrangement = false
resharper_keep_existing_linebreaks = false
resharper_place_accessorholder_attribute_on_same_line = false
resharper_place_simple_embedded_statement_on_same_line = false
resharper_resx_insert_final_newline = false
resharper_shaderlab_insert_final_newline = false
resharper_show_autodetect_configure_formatting_tip = false
resharper_space_within_single_line_array_initializer_braces = false
resharper_T4_insert_final_newline = false
resharper_use_heuristics_for_body_style = true
resharper_use_indent_from_vs = false
resharper_vb_insert_final_newline = false
resharper_wrap_before_eq = true
resharper_wrap_chained_binary_expressions = chop_if_long
resharper_xmldoc_insert_final_newline = false
resharper_xml_insert_final_newline = false
ShadowCommander commented 5 months ago

Discord Thread https://discord.com/channels/310555209753690112/1235489625771081759

0x6273 commented 5 months ago

end_of_line = crlf

Why???

ShadowCommander commented 5 months ago

We aren't for sure adding these. This is just to revisit the options and make sure we have all the ones we want added, since there seem to be a few more since we last looked at them 3 years ago and decide if we should add them or not.

TsjipTsjip commented 5 months ago

0x6273 does have a point about the CRLF setting, as #26401 introduced a workflow that will fail when there's anything with CRLF in the PR, or the repo at that HEAD pointer for that matter. It's a choice that you will have to make, but if CRLF is chosen, then the workflow will have to be updated accordingly.

See also .gitattributes, which I believe also has functionality for managing this.

ShadowCommander commented 5 months ago

Ah I thought they had a problem with the end_of_line setting itself, since the settings are what the discussion is about. The values are either the current default values in the IDE or (in this case) what was in the .editorconfig, but commented out. I'll remove the value for this one.

0x6273 commented 5 months ago

The workflow actually wouldn't fail since in the git index it's all lf. Currently you can checkout and use whatever line ending you want in your worktree as long as commits are lf.

If we are going to force everyone to use a specific line ending style in the worktree like the issue author seemingly wants, it should be lf so that it's consistent with index.

0x6273 commented 5 months ago

Ah I thought they had a problem with the end_of_line setting itself

I do have a problem with it. Is there a reason why you want to force a specific line ending in people's worktrees? In git it's all the same so why does it matter to you? Is there some technical reason?

ShadowCommander commented 5 months ago

I wanted to know why it was commented out in the .editorconfig, so I put it on the list to get arguments for or against.

I don't have a lot of experience with the problems that line ending can or do cause, so I've put it on the list for others such as you to discuss whether we want it in the file or not.

Please stop assuming maliciousness. I'm not forcing anything here. Since it's a problem, it'd help if you could list out the problem clearly so that we can have comments why it isn't being included for future reference.