Skip to content

Commit 291ca3c

Browse files
author
Dmitriy Yukhanov
committed
Add .editorconfig
1 parent 6e54f33 commit 291ca3c

1 file changed

Lines changed: 221 additions & 0 deletions

File tree

  • Unity Projects/Package2Folder Master/Assets/Plugins/CodeStage/Package2Folder
Lines changed: 221 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,221 @@
1+
root = true
2+
3+
##################################################
4+
# Code Stage C# Root EditorConfig #
5+
# https://codestage.net #
6+
##################################################
7+
8+
# All files
9+
[*]
10+
indent_style = tab
11+
indent_size = tab
12+
charset = utf-8
13+
tab_width = 4
14+
15+
# Code files
16+
[*.{cs, ts}]
17+
trim_trailing_whitespace = false
18+
insert_final_newline = false
19+
max_line_length = 120
20+
21+
[*.cs]
22+
resharper_csharp_indent_style = tab
23+
resharper_csharp_alignment_tab_fill_style = optimal_fill
24+
25+
###############################
26+
# .NET Coding Conventions #
27+
###############################
28+
29+
# Organize usings
30+
dotnet_sort_system_directives_first = true
31+
dotnet_separate_import_directive_groups = false
32+
resharper_csharp_sort_usings_with_system_first = true
33+
csharp_using_directive_placement = outside_namespace : suggestion
34+
35+
# this. preferences
36+
dotnet_style_qualification_for_field = false : suggestion
37+
dotnet_style_qualification_for_property = false : suggestion
38+
dotnet_style_qualification_for_method = false : suggestion
39+
dotnet_style_qualification_for_event = false : suggestion
40+
resharper_csharp_static_members_qualify_members = none
41+
42+
# Language keywords vs BCL types preferences
43+
dotnet_style_predefined_type_for_locals_parameters_members = true : suggestion
44+
dotnet_style_predefined_type_for_member_access = true : suggestion
45+
46+
# Modifier preferences
47+
dotnet_style_require_accessibility_modifiers = always : suggestion
48+
dotnet_style_readonly_field = true : suggestion
49+
resharper_arrange_type_member_modifiers_highlighting = suggestion
50+
51+
# Expression-level preferences
52+
dotnet_style_object_initializer = true : suggestion
53+
dotnet_style_collection_initializer = true : suggestion
54+
resharper_use_object_or_collection_initializer_highlighting = suggestion
55+
56+
dotnet_style_explicit_tuple_names = true : suggestion
57+
dotnet_style_null_propagation = true : suggestion
58+
resharper_use_null_propagation_highlighting = suggestion
59+
dotnet_style_coalesce_expression = true : suggestion
60+
resharper_convert_if_statement_to_null_coalescing_expression_highlighting = suggestion
61+
resharper_convert_to_null_coalescing_compound_assignment_highlighting = suggestion
62+
dotnet_style_prefer_is_null_check_over_reference_equality_method = true : suggestion
63+
dotnet_style_prefer_inferred_tuple_names = true : suggestion
64+
dotnet_style_prefer_inferred_anonymous_type_member_names = true : suggestion
65+
dotnet_style_prefer_auto_properties = true : suggestion
66+
resharper_convert_to_auto_property_highlighting = suggestion
67+
resharper_auto_property_can_be_made_get_only_global_highlighting = suggestion
68+
resharper_auto_property_can_be_made_get_only_local_highlighting = suggestion
69+
resharper_check_namespace_highlighting = silent
70+
71+
###############################
72+
# Naming Conventions #
73+
###############################
74+
75+
# Style Definitions
76+
dotnet_naming_style.pascal_case_style.capitalization = pascal_case
77+
dotnet_naming_style.camel_case_style.capitalization = camel_case
78+
79+
# Use PascalCase for constant fields
80+
dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion
81+
dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields
82+
dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style
83+
dotnet_naming_symbols.constant_fields.applicable_kinds = field
84+
dotnet_naming_symbols.constant_fields.applicable_accessibilities = *
85+
dotnet_naming_symbols.constant_fields.required_modifiers = const
86+
87+
# Use PascalCase for events
88+
dotnet_naming_rule.events_should_be_pascal_case.severity = suggestion
89+
dotnet_naming_rule.events_should_be_pascal_case.symbols = events
90+
dotnet_naming_rule.events_should_be_pascal_case.style = pascal_case_style
91+
dotnet_naming_symbols.events.applicable_kinds = event
92+
dotnet_naming_symbols.events.applicable_accessibilities = *
93+
94+
# Use PascalCase for readonly static fields
95+
dotnet_naming_rule.readonly_static_fields_should_be_pascal_case.severity = suggestion
96+
dotnet_naming_rule.readonly_static_fields_should_be_pascal_case.symbols = readonly_static_fields
97+
dotnet_naming_rule.readonly_static_fields_should_be_pascal_case.style = pascal_case_style
98+
dotnet_naming_symbols.readonly_static_fields.applicable_kinds = field
99+
dotnet_naming_symbols.readonly_static_fields.applicable_accessibilities = *
100+
dotnet_naming_symbols.readonly_static_fields.required_modifiers = readonly, static
101+
102+
# Use camelCase for fields
103+
dotnet_naming_rule.fields_should_be_camel_case.severity = suggestion
104+
dotnet_naming_rule.fields_should_be_camel_case.symbols = fields
105+
dotnet_naming_rule.fields_should_be_camel_case.style = camel_case_style
106+
dotnet_naming_symbols.fields.applicable_kinds = field
107+
dotnet_naming_symbols.fields.applicable_accessibilities = *
108+
109+
###############################
110+
# C# Coding Conventions #
111+
###############################
112+
113+
# var preferences
114+
# csharp_style_var_for_built_in_types = true : warning
115+
# csharp_style_var_when_type_is_apparent = true : warning
116+
csharp_style_var_elsewhere = true : suggestion
117+
resharper_csharp_for_simple_types = can_use_either
118+
resharper_csharp_for_built_in_types = can_use_either
119+
resharper_csharp_for_other_types = use_var
120+
121+
# Expression-bodied members
122+
csharp_style_expression_bodied_methods = false : suggestion
123+
csharp_style_expression_bodied_constructors = false : suggestion
124+
csharp_style_expression_bodied_operators = false : suggestion
125+
csharp_style_expression_bodied_properties = true : suggestion
126+
csharp_style_expression_bodied_indexers = true : suggestion
127+
csharp_style_expression_bodied_accessors = true : suggestion
128+
129+
# Pattern matching preferences
130+
csharp_style_pattern_matching_over_is_with_cast_check = true : suggestion
131+
csharp_style_pattern_matching_over_as_with_null_check = true : suggestion
132+
resharper_use_pattern_matching_highlighting = suggestion
133+
134+
# Null-checking preferences
135+
csharp_style_throw_expression = true : suggestion
136+
csharp_style_conditional_delegate_call = true : suggestion
137+
138+
# Modifier preferences
139+
csharp_preferred_modifier_order = public, private, protected, internal, static, extern, new, virtual, abstract, sealed, override, readonly, unsafe, volatile, async : suggestion
140+
141+
# Expression-level preferences
142+
csharp_prefer_braces = true : silent
143+
csharp_style_deconstructed_variable_declaration = true : suggestion
144+
csharp_prefer_simple_default_expression = true : suggestion
145+
csharp_style_pattern_local_over_anonymous_function = true : suggestion
146+
csharp_style_inlined_variable_declaration = true : suggestion
147+
148+
###############################
149+
# C# Formatting Rules #
150+
###############################
151+
152+
# Blank lines
153+
csharp_blank_lines_around_field = 0
154+
155+
# New line preferences
156+
csharp_new_line_before_open_brace = all
157+
csharp_new_line_before_else = true
158+
csharp_new_line_before_catch = true
159+
csharp_new_line_before_finally = true
160+
csharp_new_line_before_members_in_object_initializers = true
161+
csharp_new_line_before_members_in_anonymous_types = true
162+
csharp_new_line_between_query_expression_clauses = true
163+
resharper_csharp_accessor_declaration_braces = next_line
164+
165+
# Attributes arrangement
166+
csharp_keep_existing_attribute_arrangement = true
167+
168+
# Indentation preferences
169+
csharp_indent_case_contents = true
170+
csharp_indent_switch_labels = true
171+
csharp_indent_labels = flush_left
172+
resharper_csharp_continuous_indent_multiplier = 1
173+
resharper_csharp_indent_preprocessor_if = no_indent
174+
resharper_csharp_indent_preprocessor_other = no_indent
175+
resharper_csharp_indent_preprocessor_region = usual_indent
176+
177+
# Space preferences
178+
csharp_space_after_cast = false
179+
csharp_space_after_keywords_in_control_flow_statements = true
180+
csharp_space_between_method_call_parameter_list_parentheses = false
181+
csharp_space_between_method_declaration_parameter_list_parentheses = false
182+
csharp_space_between_parentheses = false
183+
csharp_space_before_colon_in_inheritance_clause = true
184+
csharp_space_after_colon_in_inheritance_clause = true
185+
csharp_space_around_binary_operators = before_and_after
186+
csharp_space_around_binary_operator = true
187+
csharp_space_around_multiplicative_op = true
188+
resharper_space_around_nullcoalescing_op = true
189+
resharper_space_around_binary_operator = true
190+
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
191+
csharp_space_between_method_call_name_and_opening_parenthesis = false
192+
csharp_space_between_method_call_empty_parameter_list_parentheses = false
193+
194+
# Wrapping preferences
195+
csharp_preserve_single_line_statements = false
196+
csharp_preserve_single_line_blocks = true
197+
198+
###################################################################################
199+
# Unity-specific Rules #
200+
# https://github.com/JetBrains/resharper-unity/issues/1353#issuecomment-540535939 #
201+
###################################################################################
202+
203+
resharper_unity_explicit_tag_comparison_highlighting = error
204+
205+
# https://github.com/JetBrains/resharper-unity/wiki/Redundant-Unity-event-function
206+
resharper_unity_redundant_event_function_highlighting = warning
207+
208+
# https://github.com/JetBrains/resharper-unity/wiki/Prefer-using-generic-method-overload-instead-of-string
209+
resharper_unity_prefer_generic_method_overload_highlighting = error
210+
211+
# https://github.com/JetBrains/resharper-unity/wiki/Camera.main-is-inefficient-in-frequently-called-methods
212+
resharper_unity_performance_critical_code_camera_main_highlighting = warning
213+
214+
# https://github.com/JetBrains/resharper-unity/wiki/Avoid-using-string-based-names-for-setting-and-getting-properties-on-Animators,-Shaders-and-Materials
215+
resharper_unity_prefer_address_by_id_to_graphics_params_highlighting = warning
216+
217+
# https://github.com/JetBrains/resharper-unity/wiki/Avoid-using-string-based-Method-Invocation
218+
resharper_unity_performance_critical_code_invocation_highlighting = hint
219+
220+
# https://github.com/JetBrains/resharper-unity/wiki/Avoid-using-Object.Instantiate-without-%E2%80%9CTransform-Parent%E2%80%9D-parameter-and-using-SetParent-later
221+
resharper_unity_instantiate_without_parent_highlighting = warning

0 commit comments

Comments
 (0)