1- # editorconfig.org
1+ # IDE text editor configuration:
2+ #
3+ # https://editorconfig.org/
24
3- # top-most EditorConfig file
5+ # This is the top-most EditorConfig file for our repo.
46root = true
57
6- # Default settings:
7- # A newline ending every file
8- # Use 4 spaces as indentation
8+ # =================================================================================================
9+ # Default settings for all file types.
10+
911[* ]
10- insert_final_newline = true
11- indent_style = space
12- indent_size = 4
1312
14- [* .{json,jsonc} ]
13+ # Use 2 spaces for indentation.
14+ indent_style = space
1515indent_size = 2
16+ # tab_width is irrelevant, and will default to indent_size.
1617
17- [* .{yml,yaml} ]
18- indent_size = 2
18+ # Don't mess with line endings.
19+ end_of_line = unset
20+
21+ # UTF-8 encoding without BOM.
22+ charset = utf-8
23+
24+ # Trim trailing whitespace.
25+ trim_trailing_whitespace = true
26+
27+ # Ensure files end with a newline.
28+ insert_final_newline = true
29+
30+ # We're not enforcing a max line length via tooling because there are legitimate cases for longer
31+ # lines (e.g., long URLs in comments, long strings, etc). However, we recommend keeping lines to
32+ # a maximum of 100 characters for readability.
33+ #
34+ # See: https://github.com/editorconfig/editorconfig/wiki/EditorConfig-Properties#max_line_length
35+ #
36+ max_line_length = unset
37+
38+ # =================================================================================================
39+ # Shell scripts typically require line endings that match the platform's native line endings.
40+
41+ # Unix-like systems (Linux, macOS) use LF.
42+ [* .sh ]
43+ end_of_line = lf
44+
45+ # Windows uses CRLF.
46+ [* .{bat,cmd,ps1} ]
47+ end_of_line = crlf
48+
49+ # =================================================================================================
50+ # C# files.
1951
20- # C# files
2152[* .cs ]
53+
54+ # We use 4 spaces for C# indentation.
55+ indent_size = 4
56+
2257# New line preferences
2358csharp_new_line_before_open_brace = all
2459csharp_new_line_before_else = true
@@ -75,7 +110,7 @@ dotnet_naming_symbols.static_fields.applicable_kinds = field
75110dotnet_naming_symbols.static_fields.required_modifiers = static
76111
77112dotnet_naming_style.static_prefix_style.required_prefix = s_
78- dotnet_naming_style.static_prefix_style.capitalization = camel_case
113+ dotnet_naming_style.static_prefix_style.capitalization = camel_case
79114
80115# internal and private fields should be _camelCase
81116dotnet_naming_rule.camel_case_for_private_internal_fields.severity = suggestion
@@ -86,7 +121,7 @@ dotnet_naming_symbols.private_internal_fields.applicable_kinds = field
86121dotnet_naming_symbols.private_internal_fields.applicable_accessibilities = private, internal
87122
88123dotnet_naming_style.camel_case_underscore_style.required_prefix = _
89- dotnet_naming_style.camel_case_underscore_style.capitalization = camel_case
124+ dotnet_naming_style.camel_case_underscore_style.capitalization = camel_case
90125
91126# Code style defaults
92127dotnet_sort_system_directives_first = true
@@ -143,6 +178,9 @@ csharp_space_between_square_brackets = false
143178
144179# Analyzers
145180
181+ # IDE0005: Remove unnecessary using directives
182+ dotnet_diagnostic.IDE0005.severity = suggestion
183+
146184dotnet_code_quality.ca1802.api_surface = private, internal
147185
148186# CA2000: Dispose objects before losing scope
@@ -160,16 +198,3 @@ dotnet_diagnostic.CA1416.severity = silent
160198dotnet_code_quality.CA2100.excluded_type_names_with_derived_types = Microsoft.Data.SqlClient.ManualTesting.Tests.*
161199dotnet_diagnostic.xUnit1031.severity =none
162200dotnet_diagnostic.xUnit1030.severity =none
163-
164- # Xml files
165- [* .{xml,csproj,stylecop,resx,ruleset,props,targets,config,nuspec} ]
166- indent_size = 2
167-
168- # Shell scripts
169- [* .sh ]
170- indent_size = 2
171- end_of_line = lf
172-
173- [* .{bat,cmd,ps1} ]
174- indent_size = 2
175- end_of_line = crlf
0 commit comments