coverlet
/
.editorconfig
229 строк · 10.1 Кб
1# To learn more about .editorconfig see https://aka.ms/editorconfigdocs
2
3# top-most EditorConfig file
4root = true
5
6###############################
7# Core EditorConfig Options #
8###############################
9# All files
10[*]
11insert_final_newline = true
12indent_style = space
13indent_size = 4
14trim_trailing_whitespace = true
15
16file_header_template = Copyright (c) Toni Solarin-Sodara\nLicensed under the MIT license. See LICENSE file in the project root for full license information.
17
18# XML project files
19[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}]
20indent_size = 2
21charset = utf-8
22
23# XML config files
24[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}]
25indent_size = 2
26
27# Xml build files
28[*.builds]
29indent_size = 2
30
31# Xml files
32[*.{xml,stylecop,resx,ruleset}]
33indent_size = 2
34
35# YAML config files
36[*.{yml,yaml}]
37indent_size = 2
38
39# Shell scripts
40[*.sh]
41end_of_line = lf
42[*.{cmd,bat}]
43end_of_line = crlf
44
45# Code files
46[*.{cs,csx,vb,vbx}]
47indent_size = 2
48insert_final_newline = true
49charset = utf-8-bom
50###############################
51# .NET Coding Conventions #
52###############################
53[*.{cs,vb}]
54# Organize usings
55dotnet_sort_system_directives_first = true
56## IDE0005: Using directive is unnecessary.
57dotnet_diagnostic.IDE0005.severity = warning
58## IDE0007 use 'var' instead of explicit type
59dotnet_diagnostic.IDE0007.severity = none
60# License header
61file_header_template = Copyright (c) Toni Solarin-Sodara\nLicensed under the MIT license. See LICENSE file in the project root for full license information.
62## IDE0073: The file header is missing or not located at the top of the file
63dotnet_diagnostic.IDE0073.severity = warning
64# this. preferences
65dotnet_style_qualification_for_field = false:warning
66dotnet_style_qualification_for_property = false:warning
67dotnet_style_qualification_for_method = false:warning
68dotnet_style_qualification_for_event = false:warning
69# Language keywords vs BCL types preferences
70dotnet_style_predefined_type_for_locals_parameters_members = true:silent
71dotnet_style_predefined_type_for_member_access = true:silent
72# Parentheses preferences
73dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
74dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
75dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
76dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
77# Modifier preferences
78dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent
79dotnet_style_readonly_field = true:warning
80## IDE0044: Add readonly modifier
81dotnet_diagnostic.IDE0044.severity = warning
82# Expression-level preferences
83dotnet_style_object_initializer = true:suggestion
84dotnet_style_collection_initializer = true:suggestion
85dotnet_style_explicit_tuple_names = true:suggestion
86dotnet_style_null_propagation = true:suggestion
87dotnet_style_coalesce_expression = true:suggestion
88dotnet_style_prefer_is_null_check_over_reference_equality_method = true:warning
89dotnet_style_prefer_inferred_tuple_names = true:suggestion
90dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
91dotnet_style_prefer_auto_properties = true:warning
92dotnet_style_prefer_conditional_expression_over_assignment = true:silent
93dotnet_style_prefer_conditional_expression_over_return = true:silent
94# CA1805: Do not initialize unnecessarily
95dotnet_diagnostic.CA1805.severity = warning
96# IDE0063: Use simple 'using' statement
97dotnet_diagnostic.IDE0063.severity = warning
98# IDE0057: Use range operator
99dotnet_diagnostic.IDE0057.severity = warning
100# IDE0075: Simplify conditional expression
101dotnet_diagnostic.IDE0075.severity = warning
102# IDE0071: Simplify interpolation
103dotnet_diagnostic.IDE0071.severity = warning
104# CA1829: Use Length/Count property instead of Count() when available
105dotnet_diagnostic.CA1829.severity = warning
106# CA1827: Do not use Count() or LongCount() when Any() can be used
107dotnet_diagnostic.CA1827.severity = warning
108###############################
109# Naming Conventions #
110###############################
111# Name all constant fields using PascalCase
112dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion
113dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields
114dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style
115dotnet_naming_symbols.constant_fields.applicable_kinds = field
116dotnet_naming_symbols.constant_fields.required_modifiers = const
117dotnet_naming_style.pascal_case_style.capitalization = pascal_case
118# Static fields should have s_ prefix
119dotnet_naming_rule.static_fields_should_have_prefix.severity = suggestion
120dotnet_naming_rule.static_fields_should_have_prefix.symbols = static_fields
121dotnet_naming_rule.static_fields_should_have_prefix.style = static_prefix_style
122dotnet_naming_symbols.static_fields.applicable_kinds = field
123dotnet_naming_symbols.static_fields.required_modifiers = static
124dotnet_naming_symbols.static_fields.applicable_accessibilities = private, internal, private_protected
125dotnet_naming_style.static_prefix_style.required_prefix = s_
126dotnet_naming_style.static_prefix_style.capitalization = camel_case
127# Internal and private fields should be _camelCase
128dotnet_naming_rule.camel_case_for_private_internal_fields.severity = suggestion
129dotnet_naming_rule.camel_case_for_private_internal_fields.symbols = private_internal_fields
130dotnet_naming_rule.camel_case_for_private_internal_fields.style = camel_case_underscore_style
131dotnet_naming_symbols.private_internal_fields.applicable_kinds = field
132dotnet_naming_symbols.private_internal_fields.applicable_accessibilities = private, internal
133dotnet_naming_style.camel_case_underscore_style.required_prefix = _
134dotnet_naming_style.camel_case_underscore_style.capitalization = camel_case
135# IDE1006: Naming Styles
136dotnet_diagnostic.IDE1006.severity = warning
137# IDE0090: Use 'new(...)'
138dotnet_diagnostic.IDE0090.severity = warning
139dotnet_style_operator_placement_when_wrapping = beginning_of_line
140tab_width = 2
141end_of_line = crlf
142###############################
143# C# Coding Conventions #
144###############################
145[*.cs]
146# Organize usings
147csharp_using_directive_placement = outside_namespace:silent
148# var preferences - use keywords instead of BCL types, and permit var only when the type is clear
149csharp_style_var_for_built_in_types = false:warning
150csharp_style_var_when_type_is_apparent = true:warning
151csharp_style_var_elsewhere = false:warning
152# Expression-bodied members
153csharp_style_expression_bodied_methods = false:silent
154csharp_style_expression_bodied_constructors = false:silent
155csharp_style_expression_bodied_operators = false:silent
156csharp_style_expression_bodied_properties = true:silent
157csharp_style_expression_bodied_indexers = true:silent
158csharp_style_expression_bodied_accessors = true:silent
159# Pattern matching preferences
160csharp_style_pattern_matching_over_is_with_cast_check = true:warning
161csharp_style_pattern_matching_over_as_with_null_check = true:warning
162csharp_style_prefer_not_pattern = true
163## IDE0083: Use pattern matching
164dotnet_diagnostic.IDE0083.severity = warning
165# Null-checking preferences
166csharp_style_throw_expression = true:warning
167csharp_style_conditional_delegate_call = true:warning
168# Modifier preferences
169csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:warning
170# Expression-level preferences
171csharp_prefer_braces = true:silent
172csharp_style_deconstructed_variable_declaration = true:suggestion
173csharp_prefer_simple_default_expression = true:warning
174## IDE0034: Simplify 'default' expression
175dotnet_diagnostic.IDE0034.severity = warning
176csharp_style_pattern_local_over_anonymous_function = true:suggestion
177csharp_style_inlined_variable_declaration = true:warning
178###############################
179# C# Formatting Rules #
180###############################
181# New line preferences
182csharp_new_line_before_open_brace = all
183csharp_new_line_before_else = true
184csharp_new_line_before_catch = true
185csharp_new_line_before_finally = true
186csharp_new_line_before_members_in_object_initializers = true
187csharp_new_line_before_members_in_anonymous_types = true
188csharp_new_line_between_query_expression_clauses = true
189dotnet_style_allow_multiple_blank_lines_experimental=false:warning
190# Indentation preferences
191csharp_indent_case_contents = true
192csharp_indent_switch_labels = true
193csharp_indent_block_contents = true
194csharp_indent_braces = false
195csharp_indent_case_contents_when_block = true
196csharp_indent_labels = one_less_than_current
197# Space preferences
198csharp_space_after_cast = false
199csharp_space_after_colon_in_inheritance_clause = true
200csharp_space_after_comma = true
201csharp_space_after_dot = false
202csharp_space_after_keywords_in_control_flow_statements = true
203csharp_space_after_semicolon_in_for_statement = true
204csharp_space_around_binary_operators = before_and_after
205csharp_space_around_declaration_statements = do_not_ignore
206csharp_space_before_colon_in_inheritance_clause = true
207csharp_space_before_comma = false
208csharp_space_before_dot = false
209csharp_space_before_open_square_brackets = false
210csharp_space_before_semicolon_in_for_statement = false
211csharp_space_between_empty_square_brackets = false
212csharp_space_between_method_call_empty_parameter_list_parentheses = false
213csharp_space_between_method_call_name_and_opening_parenthesis = false
214csharp_space_between_method_call_parameter_list_parentheses = false
215csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
216csharp_space_between_method_declaration_name_and_open_parenthesis = false
217csharp_space_between_method_declaration_parameter_list_parentheses = false
218csharp_space_between_parentheses = false
219csharp_space_between_square_brackets = false
220# Wrapping preferences
221csharp_preserve_single_line_statements = true
222csharp_preserve_single_line_blocks = true
223csharp_prefer_simple_using_statement = true:suggestion
224csharp_style_namespace_declarations = block_scoped:silent
225csharp_style_prefer_method_group_conversion = true:silent
226csharp_style_prefer_top_level_statements = true:silent
227csharp_style_prefer_primary_constructors = true:suggestion
228csharp_style_expression_bodied_lambdas = true:silent
229csharp_style_expression_bodied_local_functions = false:silent
230