Skip to content

Commit 1961e82

Browse files
committed
Add .editorconfig
1 parent dd2c771 commit 1961e82

File tree

2 files changed

+37
-3
lines changed

2 files changed

+37
-3
lines changed

.editorconfig

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,25 @@ insert_final_newline = true
1111
indent_style = space
1212
indent_size = 4
1313
trim_trailing_whitespace = true
14+
dotnet_style_operator_placement_when_wrapping = beginning_of_line
15+
tab_width = 4
16+
end_of_line = crlf
17+
dotnet_style_coalesce_expression = true:suggestion
18+
dotnet_style_null_propagation = true:suggestion
19+
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
20+
dotnet_style_prefer_auto_properties = true:suggestion
21+
dotnet_style_object_initializer = true:suggestion
22+
dotnet_style_collection_initializer = true:suggestion
23+
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
24+
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
25+
dotnet_style_prefer_conditional_expression_over_return = true:silent
26+
dotnet_style_explicit_tuple_names = true:suggestion
27+
dotnet_style_prefer_inferred_tuple_names = true:suggestion
28+
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
29+
dotnet_style_prefer_compound_assignment = true:suggestion
30+
dotnet_style_prefer_simplified_interpolation = true:suggestion
31+
dotnet_style_prefer_collection_expression = when_types_loosely_match:suggestion
32+
dotnet_style_namespace_match_folder = true:suggestion
1433

1534
[project.json]
1635
indent_size = 2
@@ -54,15 +73,15 @@ dotnet_style_predefined_type_for_member_access = true:suggestion
5473
# name all constant fields using PascalCase
5574
dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion
5675
dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields
57-
dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style
76+
dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style
5877
dotnet_naming_symbols.constant_fields.applicable_kinds = field
5978
dotnet_naming_symbols.constant_fields.required_modifiers = const
6079
dotnet_naming_style.pascal_case_style.capitalization = pascal_case
6180

6281
# static fields should have s_ prefix
6382
dotnet_naming_rule.static_fields_should_have_prefix.severity = suggestion
6483
dotnet_naming_rule.static_fields_should_have_prefix.symbols = static_fields
65-
dotnet_naming_rule.static_fields_should_have_prefix.style = static_prefix_style
84+
dotnet_naming_rule.static_fields_should_have_prefix.style = static_prefix_style
6685
dotnet_naming_symbols.static_fields.applicable_kinds = field
6786
dotnet_naming_symbols.static_fields.required_modifiers = static
6887
dotnet_naming_symbols.static_fields.applicable_accessibilities = private, internal, private_protected
@@ -72,7 +91,7 @@ dotnet_naming_style.static_prefix_style.capitalization = camel_case
7291
# internal and private fields should be _camelCase
7392
dotnet_naming_rule.camel_case_for_private_internal_fields.severity = suggestion
7493
dotnet_naming_rule.camel_case_for_private_internal_fields.symbols = private_internal_fields
75-
dotnet_naming_rule.camel_case_for_private_internal_fields.style = camel_case_underscore_style
94+
dotnet_naming_rule.camel_case_for_private_internal_fields.style = camel_case_underscore_style
7695
dotnet_naming_symbols.private_internal_fields.applicable_kinds = field
7796
dotnet_naming_symbols.private_internal_fields.applicable_accessibilities = private, internal
7897
dotnet_naming_style.camel_case_underscore_style.required_prefix = _
@@ -156,8 +175,20 @@ csharp_space_between_square_brackets = false
156175

157176
# Analyzers
158177
dotnet_code_quality.ca1802.api_surface = private, internal
178+
csharp_style_namespace_declarations = file_scoped:silent
179+
csharp_style_prefer_method_group_conversion = true:silent
180+
csharp_style_prefer_top_level_statements = true:silent
181+
csharp_style_prefer_primary_constructors = true:suggestion
182+
csharp_prefer_system_threading_lock = true:suggestion
183+
csharp_style_prefer_null_check_over_type_check = true:suggestion
184+
csharp_style_prefer_local_over_anonymous_function = true:suggestion
185+
csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion
159186

160187
# C++ Files
188+
189+
# SYSLIB1045: Convert to 'GeneratedRegexAttribute'.
190+
dotnet_diagnostic.SYSLIB1045.severity = silent
191+
161192
[*.{cpp,h,in}]
162193
curly_bracket_next_line = true
163194
indent_brace_style = Allman

AdventOfCode.slnx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,5 +131,8 @@
131131
<Project Path="src/2024/23/23.csproj" />
132132
<Project Path="src/2024/24/24.csproj" />
133133
</Folder>
134+
<Folder Name="/Solution Items/" Id="8ec462fd-d22e-90a8-e5ce-7e832ba40c5d">
135+
<File Path=".editorconfig" />
136+
</Folder>
134137
<Project Path="src/Common/Common.csproj" />
135138
</Solution>

0 commit comments

Comments
 (0)