From 02d5f1f175d0475d6611a5ea0ea961ef4398f029 Mon Sep 17 00:00:00 2001 From: Joanna May Date: Fri, 20 Dec 2024 02:03:58 -0600 Subject: [PATCH] fix: update rules, avoid conflicting with gdscript indentation, fix errors spotted by rider --- src/.editorconfig | 41 ++++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/src/.editorconfig b/src/.editorconfig index 3654594..68d2fb3 100644 --- a/src/.editorconfig +++ b/src/.editorconfig @@ -51,6 +51,11 @@ trim_trailing_whitespace = true # File Extension Settings ########################################## +# GDScript Files +[*.gd] +indent_style = tab +indent_size = 2 + # Visual Studio Solution Files [*.sln] indent_style = tab @@ -91,7 +96,7 @@ end_of_line = lf [Makefile] indent_style = tab -[*_Generated.cs, *.g.cs, *.generated.cs] +[*{_Generated.cs,.g.cs,.generated.cs}] # Ignore a lack of documentation for generated code. Doesn't apply to builds, # just to viewing generation output. dotnet_diagnostic.CS1591.severity = none @@ -100,7 +105,7 @@ dotnet_diagnostic.CS1591.severity = none # Default .NET Code Style Severities ########################################## -[*.{cs,csx,cake,vb,vbx}] +[*.cs] # Default Severity for all .NET Code Style rules below dotnet_analyzer_diagnostic.severity = warning @@ -109,7 +114,6 @@ dotnet_analyzer_diagnostic.severity = warning ########################################## # .NET Style Rules -[*.{cs,csx,cake,vb,vbx}] # "this." and "Me." qualifiers dotnet_style_qualification_for_field = false @@ -155,7 +159,7 @@ dotnet_style_prefer_is_null_check_over_reference_equality_method = true:warning # File header preferences # Keep operators at end of line when wrapping. -dotnet_style_operator_placement_when_wrapping = end_of_line:warning +dotnet_style_operator_placement_when_wrapping = end_of_line csharp_style_prefer_null_check_over_type_check = true:warning # Code block preferences @@ -164,7 +168,7 @@ csharp_prefer_simple_using_statement = true:suggestion dotnet_diagnostic.IDE0063.severity = suggestion # C# Style Rules -[*.{cs,csx,cake}] + # 'var' preferences csharp_style_var_for_built_in_types = true:warning csharp_style_var_when_type_is_apparent = true:warning @@ -208,14 +212,12 @@ dotnet_code_quality.CA1822.api_surface = private ########################################## # .NET Unnecessary code rules -[*.{cs,csx,cake,vb,vbx}] dotnet_code_quality_unused_parameters = non_public:suggestion dotnet_remove_unnecessary_suppression_exclusions = none dotnet_diagnostic.IDE0079.severity = warning # C# Unnecessary code rules -[*.{cs,csx,cake}] # Chickensoft Unused Code Additions # @@ -240,7 +242,6 @@ dotnet_diagnostic.RCS1213.severity = none csharp_style_unused_value_expression_statement_preference = discard_variable # .NET formatting rules -[*.{cs,csx,cake,vb,vbx}] # Organize using directives dotnet_sort_system_directives_first = true @@ -255,7 +256,6 @@ dotnet_style_namespace_match_folder = false dotnet_diagnostic.IDE0130.severity = none # C# formatting rules -[*.{cs,csx,cake}] # Newline options csharp_new_line_before_open_brace = none @@ -308,7 +308,6 @@ csharp_style_namespace_declarations = file_scoped:warning ########################################## # .NET Naming Rules ########################################## -[*.{cs,csx,cake,vb,vbx}] ########################################## # Chickensoft Naming Conventions & Styles @@ -343,7 +342,7 @@ dotnet_naming_rule.non_public_fields_under_camel.symbols = non_public_fields dotnet_naming_rule.non_public_fields_under_camel.style = camel_case_underscore_style dotnet_naming_symbols.non_public_fields.applicable_kinds = field dotnet_naming_symbols.non_public_fields.required_modifiers = -dotnet_naming_symbols.non_public_fields.applicable_accessibilities = private,private_protected,protected,internal,protected,protected_internal +dotnet_naming_symbols.non_public_fields.applicable_accessibilities = private,private_protected,internal,protected,protected_internal # Public fields should be PascalCase dotnet_naming_rule.public_fields_pascal.severity = suggestion @@ -410,8 +409,6 @@ dotnet_naming_symbols.unspecified.applicable_accessibilities = * # Chickensoft Rule Overrides ########################################## -# Allow using keywords as names -# dotnet_diagnostic.CA1716.severity = none # Don't require culture info for ToString() dotnet_diagnostic.CA1304.severity = none # Don't require a string comparison for comparing strings. @@ -429,9 +426,9 @@ dotnet_diagnostic.IDE0059.severity = none # Switch/case should always have a default clause. Tell that to Roslynator. dotnet_diagnostic.RCS1070.severity = none # Tell roslynator not to eat unused parameters. -dotnet_diagnostic.RCS1163.severity = none +dotnet_diagnostic.RCS1163.severity = suggestion # Tell dotnet not to remove unused parameters. -dotnet_diagnostic.IDE0060.severity = none +dotnet_diagnostic.IDE0060.severity = suggestion # Tell roslynator not to remove `partial` modifiers. dotnet_diagnostic.RCS1043.severity = none # Tell roslynator not to make classes static so aggressively. @@ -442,10 +439,6 @@ dotnet_diagnostic.RCS1170.severity = none # Allow expression values to go unused, even without discard variable. # Otherwise, using Moq would be way too verbose. dotnet_diagnostic.IDE0058.severity = none -# Don't let roslynator turn every local variable into a const. -# If we did, we'd have to specify the types of local variables far more often, -# and this style prefers type inference. -dotnet_diagnostic.RCS1118.severity = none # Enums don't need to declare explicit values. Everyone knows they start at 0. dotnet_diagnostic.RCS1161.severity = none # Allow unconstrained type parameter to be checked for null. @@ -462,5 +455,11 @@ dotnet_diagnostic.IDE0290.severity = none dotnet_diagnostic.IDE0046.severity = none # Don't make me use expression bodies for methods dotnet_diagnostic.IDE0022.severity = none -# Don't make me populate a switch expression redundantly -dotnet_diagnostic.IDE0072.severity = none +# DO make me populate a *switch expression* +dotnet_diagnostic.IDE0072.severity = warning +# Don't make me populate a *switch statement* +dotnet_diagnostic.IDE0010.severity = none +# Make local functions static +dotnet_diagnostic.IDE0062.severity = warning +# Don't make me use properties if I don't want to. +dotnet_diagnostic.IDE0032.severity = none