1- # Version: 1.6.2 (Using https://semver.org/)
2- # Updated: 2020-11-02
1+ # Version: 2.1.0 (Using https://semver.org/)
2+ # Updated: 2021-03-03
33# See https://github.com/RehanSaeed/EditorConfig/releases for release notes.
44# See https://github.com/RehanSaeed/EditorConfig for updates to this file.
55# See http://EditorConfig.org for more information about .editorconfig files.
@@ -60,87 +60,84 @@ indent_size = 2
6060[* .{cmd,bat} ]
6161end_of_line = crlf
6262
63+ # Bash Files
64+ [* .sh ]
65+ end_of_line = lf
66+
6367# Makefiles
6468[Makefile ]
6569indent_style = tab
6670
6771# #########################################
68- # File Header (Uncomment to support file headers)
69- # https://docs.microsoft.com/visualstudio/ide/reference/add-file-header
72+ # Default .NET Code Style Severities
73+ # https://docs.microsoft.com/dotnet/fundamentals/code-analysis/configuration-options#scope
7074# #########################################
7175
72- # [*.{cs,csx,cake,vb,vbx,tt,ttinclude}]
73- file_header_template = Copyright (c) Six Labors.\nLicensed under the Apache License, Version 2 .0.
74-
75- # SA1636: File header copyright text should match
76- # Justification: .editorconfig supports file headers. If this is changed to a value other than "none", a stylecop.json file will need to added to the project.
77- # dotnet_diagnostic.SA1636.severity = none
76+ [* .{cs,csx,cake,vb,vbx} ]
77+ # Default Severity for all .NET Code Style rules below
78+ dotnet_analyzer_diagnostic.severity = warning
7879
7980# #########################################
80- # .NET Language Conventions
81- # https://docs.microsoft.com/visualstudio/ide/editorconfig- language-conventions
81+ # Language Rules
82+ # https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ language-rules
8283# #########################################
8384
84- # .NET Code Style Settings
85- # https://docs.microsoft.com/visualstudio/ide/editorconfig- language-conventions #net-code- style-settings
85+ # .NET Style Rules
86+ # https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ language-rules #net-style-rules
8687[* .{cs,csx,cake,vb,vbx} ]
8788# "this." and "Me." qualifiers
88- # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#this-and-me
8989dotnet_style_qualification_for_field = true :warning
9090dotnet_style_qualification_for_property = true :warning
9191dotnet_style_qualification_for_method = true :warning
9292dotnet_style_qualification_for_event = true :warning
9393# Language keywords instead of framework type names for type references
94- # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#language-keywords
9594dotnet_style_predefined_type_for_locals_parameters_members = true :warning
9695dotnet_style_predefined_type_for_member_access = true :warning
9796# Modifier preferences
98- # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#normalize-modifiers
9997dotnet_style_require_accessibility_modifiers = always:warning
10098csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:warning
10199visual_basic_preferred_modifier_order = Partial,Default,Private,Protected,Public,Friend,NotOverridable,Overridable,MustOverride,Overloads,Overrides,MustInherit,NotInheritable,Static,Shared,Shadows,ReadOnly,WriteOnly,Dim,Const,WithEvents,Widening,Narrowing,Custom,Async:warning
102100dotnet_style_readonly_field = true :warning
103101# Parentheses preferences
104- # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#parentheses-preferences
105102dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:warning
106103dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:warning
107104dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:warning
108- dotnet_style_parentheses_in_other_operators = never_if_unnecessary :suggestion
105+ dotnet_style_parentheses_in_other_operators = always_for_clarity :suggestion
109106# Expression-level preferences
110- # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#expression-level-preferences
111107dotnet_style_object_initializer = true :warning
112108dotnet_style_collection_initializer = true :warning
113109dotnet_style_explicit_tuple_names = true :warning
114110dotnet_style_prefer_inferred_tuple_names = true :warning
115111dotnet_style_prefer_inferred_anonymous_type_member_names = true :warning
116112dotnet_style_prefer_auto_properties = true :warning
117- dotnet_style_prefer_is_null_check_over_reference_equality_method = true :warning
118113dotnet_style_prefer_conditional_expression_over_assignment = false :suggestion
114+ dotnet_diagnostic.IDE0045.severity = suggestion
119115dotnet_style_prefer_conditional_expression_over_return = false :suggestion
116+ dotnet_diagnostic.IDE0046.severity = suggestion
120117dotnet_style_prefer_compound_assignment = true :warning
118+ dotnet_style_prefer_simplified_interpolation = true :warning
119+ dotnet_style_prefer_simplified_boolean_expressions = true :warning
121120# Null-checking preferences
122- # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#null-checking-preferences
123121dotnet_style_coalesce_expression = true :warning
124122dotnet_style_null_propagation = true :warning
125- # Parameter preferences
126- # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#parameter-preferences
127- dotnet_code_quality_unused_parameters = all:warning
128- # More style options (Undocumented)
129- # https://github.com/MicrosoftDocs/visualstudio-docs/issues/3641
123+ dotnet_style_prefer_is_null_check_over_reference_equality_method = true :warning
124+ # File header preferences
125+ file_header_template = Copyright (c) Six Labors.\nLicensed under the Apache License, Version 2 .0.
126+ # SA1636: File header copyright text should match
127+ # Justification: .editorconfig supports file headers. If this is changed to a value other than "none", a stylecop.json file will need to added to the project.
128+ # dotnet_diagnostic.SA1636.severity = none
129+
130+ # Undocumented
130131dotnet_style_operator_placement_when_wrapping = end_of_line
131- # https://github.com/dotnet/roslyn/pull/40070
132- dotnet_style_prefer_simplified_interpolation = true :warning
133132
134- # C# Code Style Settings
135- # https://docs.microsoft.com/visualstudio/ide/editorconfig- language-conventions #c-code- style-settings
133+ # C# Style Rules
134+ # https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ language-rules #c-style-rules
136135[* .{cs,csx,cake} ]
137- # Implicit and explicit types
138- # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#implicit-and-explicit-types
136+ # 'var' preferences
139137csharp_style_var_for_built_in_types = never
140138csharp_style_var_when_type_is_apparent = true :warning
141139csharp_style_var_elsewhere = false :warning
142140# Expression-bodied members
143- # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#expression-bodied-members
144141csharp_style_expression_bodied_methods = true :warning
145142csharp_style_expression_bodied_constructors = true :warning
146143csharp_style_expression_bodied_operators = true :warning
@@ -149,47 +146,64 @@ csharp_style_expression_bodied_indexers = true:warning
149146csharp_style_expression_bodied_accessors = true :warning
150147csharp_style_expression_bodied_lambdas = true :warning
151148csharp_style_expression_bodied_local_functions = true :warning
152- # Pattern matching
153- # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#pattern-matching
149+ # Pattern matching preferences
154150csharp_style_pattern_matching_over_is_with_cast_check = true :warning
155151csharp_style_pattern_matching_over_as_with_null_check = true :warning
156- # Inlined variable declarations
157- # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#inlined-variable-declarations
158- csharp_style_inlined_variable_declaration = true :warning
152+ csharp_style_prefer_switch_expression = true : warning
153+ csharp_style_prefer_pattern_matching = true : warning
154+ csharp_style_prefer_not_pattern = true :warning
159155# Expression-level preferences
160- # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#expression-level-preferences
156+ csharp_style_inlined_variable_declaration = true : warning
161157csharp_prefer_simple_default_expression = true :warning
158+ csharp_style_pattern_local_over_anonymous_function = true :warning
159+ csharp_style_deconstructed_variable_declaration = true :warning
160+ csharp_style_prefer_index_operator = true :warning
161+ csharp_style_prefer_range_operator = true :warning
162+ csharp_style_implicit_object_creation_when_type_is_apparent = true :warning
162163# "Null" checking preferences
163- # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#c-null-checking-preferences
164164csharp_style_throw_expression = true :warning
165165csharp_style_conditional_delegate_call = true :warning
166166# Code block preferences
167- # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#code-block-preferences
168167csharp_prefer_braces = true :warning
169- # Unused value preferences
170- # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#unused-value-preferences
171- csharp_style_unused_value_expression_statement_preference = discard_variable:suggestion
172- csharp_style_unused_value_assignment_preference = discard_variable:suggestion
173- # Index and range preferences
174- # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#index-and-range-preferences
175- csharp_style_prefer_index_operator = true :warning
176- csharp_style_prefer_range_operator = true :warning
177- # Miscellaneous preferences
178- # https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#miscellaneous-preferences
179- csharp_style_deconstructed_variable_declaration = true :warning
180- csharp_style_pattern_local_over_anonymous_function = true :warning
168+ csharp_prefer_simple_using_statement = true :suggestion
169+ dotnet_diagnostic.IDE0063.severity = suggestion
170+ # 'using' directive preferences
181171csharp_using_directive_placement = outside_namespace:warning
172+ # Modifier preferences
182173csharp_prefer_static_local_function = true :warning
183- csharp_prefer_simple_using_statement = true :suggestion
184174
185175# #########################################
186- # .NET Formatting Conventions
187- # https://docs.microsoft.com/visualstudio/ide/editorconfig- code-style-settings-reference#formatting-conventions
176+ # Unnecessary Code Rules
177+ # https://docs.microsoft.com/dotnet/fundamentals/ code-analysis/ style-rules/unnecessary-code-rules
188178# #########################################
189179
190- # Organize usings
191- # https://docs.microsoft.com/visualstudio/ide/editorconfig-formatting-conventions#organize-using-directives
180+ # .NET Unnecessary code rules
181+ [* .{cs,csx,cake,vb,vbx} ]
182+ dotnet_code_quality_unused_parameters = all:warning
183+ dotnet_remove_unnecessary_suppression_exclusions = none:warning
184+
185+ # C# Unnecessary code rules
186+ [* .{cs,csx,cake} ]
187+ csharp_style_unused_value_expression_statement_preference = discard_variable:suggestion
188+ dotnet_diagnostic.IDE0058.severity = suggestion
189+ csharp_style_unused_value_assignment_preference = discard_variable:suggestion
190+ dotnet_diagnostic.IDE0059.severity = suggestion
191+
192+ # #########################################
193+ # Formatting Rules
194+ # https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/formatting-rules
195+ # #########################################
196+
197+ # .NET formatting rules
198+ # https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/formatting-rules#net-formatting-rules
199+ [* .{cs,csx,cake,vb,vbx} ]
200+ # Organize using directives
192201dotnet_sort_system_directives_first = true
202+ dotnet_separate_import_directive_groups = false
203+
204+ # C# formatting rules
205+ # https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/formatting-rules#c-formatting-rules
206+ [* .{cs,csx,cake} ]
193207# Newline options
194208# https://docs.microsoft.com/visualstudio/ide/editorconfig-formatting-conventions#new-line-options
195209csharp_new_line_before_open_brace = all
@@ -231,14 +245,14 @@ csharp_space_around_declaration_statements = false
231245csharp_space_before_open_square_brackets = false
232246csharp_space_between_empty_square_brackets = false
233247csharp_space_between_square_brackets = false
234- # Wrapping options
248+ # Wrap options
235249# https://docs.microsoft.com/visualstudio/ide/editorconfig-formatting-conventions#wrap-options
236250csharp_preserve_single_line_statements = false
237251csharp_preserve_single_line_blocks = true
238252
239253# #########################################
240- # .NET Naming Conventions
241- # https://docs.microsoft.com/visualstudio/ide/editorconfig- naming-conventions
254+ # .NET Naming Rules
255+ # https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ naming-rules
242256# #########################################
243257
244258[* .{cs,csx,cake,vb,vbx} ]
@@ -261,8 +275,9 @@ dotnet_naming_style.prefix_type_parameters_with_t_style.capitalization = pascal_
261275dotnet_naming_style.prefix_type_parameters_with_t_style.required_prefix = T
262276# disallowed_style - Anything that has this style applied is marked as disallowed
263277dotnet_naming_style.disallowed_style.capitalization = pascal_case
264- dotnet_naming_style.disallowed_style.required_prefix = ____RULE_VIOLATION____
265- dotnet_naming_style.disallowed_style.required_suffix = ____RULE_VIOLATION____
278+ # Disabled while we investigate compatibility with VS 16.10
279+ # dotnet_naming_style.disallowed_style.required_prefix = ____RULE_VIOLATION____
280+ # dotnet_naming_style.disallowed_style.required_suffix = ____RULE_VIOLATION____
266281# internal_error_style - This style should never occur... if it does, it indicates a bug in file or in the parser using the file
267282dotnet_naming_style.internal_error_style.capitalization = pascal_case
268283dotnet_naming_style.internal_error_style.required_prefix = ____INTERNAL_ERROR____
0 commit comments