FastScriptReload icon indicating copy to clipboard operation
FastScriptReload copied to clipboard

Add .editorconfig file

Open SamPruden opened this issue 2 years ago • 2 comments

Now that this is open source, it would be good to have an .editorconfig setup for the project to help contributors maintain a consistent style.

SamPruden avatar Jun 24 '23 19:06 SamPruden

that's good idea, thanks

handzlikchris avatar Jul 15 '23 10:07 handzlikchris

It's probably a good idea to set this up to disallow newer C# features that aren't available in Unity versions we're targeting. Based on the README, I take it that's 2019.x+, so nothing newer than C# 7.3. I know that I have a bad habit of forgetting which features are allowed where and accidentally writing code that's too modern.

Now that I think about it, I should probably be doing my FSR development in an older Unity version.

Some rules which might be relevant include:

csharp_style_prefer_switch_expression = false
csharp_prefer_static_local_function= false
csharp_style_implicit_object_creation_when_type_is_apparent = false
csharp_style_prefer_not_pattern = false
csharp_style_prefer_pattern_matching = false // Some of this is available in C# 7.3, but some isn't
csharp_prefer_simple_using_statement = false
csharp_style_prefer_range_operator = false
csharp_style_prefer_index_operator = false // I had no idea this feature existed until right now! Very cool.

I compiled this list by googling site:https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/ "c# 8.0" and site:https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/ "c# 9.0". I don't know whether that robustly finds all of the relevant rules.

SamPruden avatar Jul 15 '23 14:07 SamPruden