Skip to content
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

Add .editorconfig file #89

Open
SamPruden opened this issue Jun 24, 2023 · 2 comments
Open

Add .editorconfig file #89

SamPruden opened this issue Jun 24, 2023 · 2 comments
Labels
feature New feature or request

Comments

@SamPruden
Copy link
Contributor

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.

@handzlikchris
Copy link
Owner

that's good idea, thanks

@handzlikchris handzlikchris added the feature New feature or request label Jul 15, 2023
@SamPruden
Copy link
Contributor Author

SamPruden commented Jul 15, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
Status: No status
Development

No branches or pull requests

2 participants