Skip to content

Commit a042554

Browse files
author
Bret Johnson
authored
Add .editorconfig, copied from xamarin-android (#55)
1 parent a0973d4 commit a042554

File tree

1 file changed

+199
-0
lines changed

1 file changed

+199
-0
lines changed

.editorconfig

Lines changed: 199 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,199 @@
1+
###############################
2+
# Core EditorConfig Options #
3+
###############################
4+
5+
root = true
6+
7+
# All files
8+
[*]
9+
charset = utf-8
10+
trim_trailing_whitespace = true
11+
12+
# MSBuild
13+
[*.{csproj,proj,projitems,shproj,fsproj,targets,props}]
14+
indent_style = space
15+
indent_size = 2
16+
17+
# XML config files
18+
[*.{xml,axml,xaml,config,nuspec,resx}]
19+
indent_style = space
20+
indent_size = 2
21+
22+
# JSON files
23+
[*.json]
24+
indent_style = space
25+
indent_size = 2
26+
27+
# F# files
28+
[*.{fs, fsx, fsi}]
29+
indent_style = space
30+
indent_size = 4
31+
32+
# Code files
33+
[*.{cs,csx,vb,vbx}]
34+
insert_final_newline = true
35+
indent_style = tab
36+
tab_width = 8
37+
indent_size = 8
38+
max_line_length = 180
39+
40+
###############################
41+
# .NET Coding Conventions #
42+
###############################
43+
44+
[*.{cs,vb}]
45+
# Organize usings
46+
dotnet_sort_system_directives_first = true
47+
dotnet_separate_import_directive_groups = false
48+
49+
# Avoid "this." and "Me." if not necessary
50+
dotnet_style_qualification_for_field = false:suggestion
51+
dotnet_style_qualification_for_property = false:suggestion
52+
dotnet_style_qualification_for_method = false:suggestion
53+
dotnet_style_qualification_for_event = false:suggestion
54+
55+
# Use language keywords instead of framework type names for type references
56+
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
57+
dotnet_style_predefined_type_for_member_access = true:suggestion
58+
59+
# Suggest more modern language features when available
60+
dotnet_style_object_initializer = true:suggestion
61+
dotnet_style_collection_initializer = true:suggestion
62+
dotnet_style_coalesce_expression = true:suggestion
63+
dotnet_style_null_propagation = true:suggestion
64+
dotnet_style_explicit_tuple_names = true:suggestion
65+
66+
# Parentheses preferences
67+
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
68+
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
69+
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
70+
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
71+
72+
# Avoid redundant accessibility modifiers when they're default
73+
dotnet_style_require_accessibility_modifiers = omit_if_default:suggestion
74+
dotnet_style_readonly_field = true:suggestion
75+
76+
# Expression-level preferences
77+
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
78+
dotnet_style_prefer_inferred_tuple_names = true:suggestion
79+
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
80+
dotnet_style_prefer_auto_properties = true:silent
81+
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
82+
dotnet_style_prefer_conditional_expression_over_return = true:silent
83+
84+
###############################
85+
# Naming Conventions #
86+
###############################
87+
88+
# Style Definitions
89+
dotnet_naming_style.pascal_case_style.capitalization = pascal_case
90+
91+
dotnet_naming_style.underline_separator.word_separator = _
92+
dotnet_naming_style.underline_separator.capitalization = all_lower
93+
94+
# Symbol Definitions
95+
dotnet_naming_symbols.parameters.applicable_kinds = parameter
96+
dotnet_naming_symbols.parameters.applicable_accessibilities = *
97+
98+
dotnet_naming_symbols.fields.applicable_kinds = field
99+
100+
dotnet_naming_symbols.constant_fields.applicable_kinds = field
101+
dotnet_naming_symbols.constant_fields.applicable_accessibilities = *
102+
dotnet_naming_symbols.constant_fields.required_modifiers = const
103+
104+
# Use CamelCase for parameters
105+
dotnet_naming_rule.method_parameters_should_be_camel_case.severity = suggestion
106+
dotnet_naming_rule.method_parameters_should_be_camel_case.symbols = parameters
107+
dotnet_naming_rule.method_parameters_should_be_camel_case.style = camel_case
108+
109+
# Use PascalCase for constant fields
110+
dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion
111+
dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields
112+
dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style
113+
114+
# Use underline separator for instance fields
115+
dotnet_naming_rule.fields_should_be_underline_separator.severity = suggestion
116+
dotnet_naming_rule.fields_should_be_underline_separator.symbols = fields
117+
dotnet_naming_rule.fields_should_be_underline_separator.style = underline_separator
118+
119+
120+
###############################
121+
# C# Code Style Rules #
122+
###############################
123+
124+
[*.cs]
125+
# var preferences
126+
csharp_style_var_for_built_in_types = true:silent
127+
csharp_style_var_when_type_is_apparent = true:silent
128+
csharp_style_var_elsewhere = true:silent
129+
130+
# Expression-bodied members
131+
csharp_style_expression_bodied_methods = false:silent
132+
csharp_style_expression_bodied_constructors = false:silent
133+
csharp_style_expression_bodied_operators = false:silent
134+
csharp_style_expression_bodied_properties = true:silent
135+
csharp_style_expression_bodied_indexers = true:silent
136+
csharp_style_expression_bodied_accessors = true:silent
137+
138+
# Pattern-matching preferences
139+
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
140+
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
141+
142+
# Null-checking preferences
143+
csharp_style_throw_expression = true:suggestion
144+
csharp_style_conditional_delegate_call = true:suggestion
145+
146+
# Modifier preferences
147+
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion
148+
149+
# Expression-level preferences
150+
csharp_prefer_braces = true:silent
151+
csharp_style_deconstructed_variable_declaration = true:suggestion
152+
csharp_prefer_simple_default_expression = true:suggestion
153+
csharp_style_pattern_local_over_anonymous_function = true:suggestion
154+
csharp_style_inlined_variable_declaration = true:suggestion
155+
156+
###############################
157+
# C# Formatting Rules #
158+
###############################
159+
160+
# Newline settings
161+
csharp_new_line_before_open_brace = methods,types
162+
csharp_new_line_before_else = false
163+
csharp_new_line_before_catch = false
164+
csharp_new_line_before_finally = false
165+
csharp_new_line_before_members_in_object_initializers = true
166+
csharp_new_line_before_members_in_anonymous_types = true
167+
168+
# Indentation preferences
169+
csharp_indent_switch_labels = false
170+
csharp_indent_case_contents = true
171+
csharp_indent_switch_labels = true
172+
173+
# Space preferences
174+
csharp_space_after_cast = true
175+
csharp_space_after_keywords_in_control_flow_statements = true
176+
csharp_space_between_method_call_parameter_list_parentheses = false
177+
csharp_space_between_method_declaration_parameter_list_parentheses = false
178+
csharp_space_between_parentheses = false
179+
csharp_space_before_colon_in_inheritance_clause = true
180+
csharp_space_after_colon_in_inheritance_clause = true
181+
csharp_space_around_binary_operators = before_and_after
182+
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
183+
csharp_space_between_method_call_name_and_opening_parenthesis = true
184+
csharp_space_between_method_call_empty_parameter_list_parentheses = false
185+
csharp_space_between_method_declaration_name_and_open_parenthesis = true
186+
csharp_space_after_keywords_in_control_flow_statements = true
187+
csharp_space_before_open_square_brackets = true
188+
189+
# Wrapping preferences
190+
csharp_preserve_single_line_statements = true
191+
csharp_preserve_single_line_blocks = true
192+
193+
##################################
194+
# Visual Basic Code Style Rules #
195+
##################################
196+
197+
[*.vb]
198+
# Modifier preferences
199+
visual_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:suggestion

0 commit comments

Comments
 (0)