Skip to content

Commit 451c0f7

Browse files
committed
Updated EditorConfig to match ILSpy (PR icsharpcode#129) and suppress some Roslyn style errors
1 parent df048ed commit 451c0f7

File tree

2 files changed

+119
-3
lines changed

2 files changed

+119
-3
lines changed

.editorconfig

Lines changed: 119 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,139 @@ root = true
55
[*]
66
end_of_line = crlf
77
indent_style = tab
8+
indent_size = 4
9+
guidelines = 110
810

9-
# Powershell
1011
[*.{ps1,psd1,psm1}]
1112
indent_style = space
1213
indent_size = 4
1314
trim_trailing_whitespace = true
15+
[*.il]
16+
indent_style = space
17+
indent_size = 2
18+
[*.{yml,yaml}]
19+
indent_style = space
20+
indent_size = 2
21+
[*.csproj]
22+
indent_style = space
23+
indent_size = 2
24+
[*.config]
25+
indent_style = space
26+
indent_size = 2
27+
[*.nuspec]
28+
indent_style = space
29+
indent_size = 2
30+
[*.vsixmanifest]
31+
indent_style = space
32+
indent_size = 2
33+
[*.vsct]
34+
indent_style = space
35+
indent_size = 2
1436

1537
[*.{cs,csx}]
1638
tab_width = 4
1739
indent_size = 4
18-
end_of_line = crlf
1940
indent_style = tab
41+
end_of_line = crlf
2042
charset = utf-8-bom
2143
trim_trailing_whitespace = true
2244
insert_final_newline = true
2345

46+
# New line preferences
47+
csharp_new_line_before_open_brace = methods, types, control_blocks, local_functions
48+
csharp_new_line_before_else = true
49+
csharp_new_line_before_catch = true
50+
csharp_new_line_before_finally = true
51+
csharp_new_line_before_members_in_object_initializers = false
52+
csharp_new_line_before_members_in_anonymous_types = false
53+
csharp_new_line_within_query_expression_clauses = false
54+
55+
# Indentation preferences
56+
csharp_indent_block_contents = true
57+
csharp_indent_braces = false
58+
csharp_indent_case_contents = true
59+
csharp_indent_case_contents_when_block = false
60+
csharp_indent_switch_labels = true
61+
csharp_indent_labels = one_less
62+
63+
# Avoid 'this.' in generated code unless absolutely necessary, but allow developers to use it
64+
dotnet_style_qualification_for_field = false:silent
65+
dotnet_style_qualification_for_property = false:silent
66+
dotnet_style_qualification_for_method = false:silent
67+
dotnet_style_qualification_for_event = false:silent
68+
69+
# Do not use 'var' when generating code, but allow developers to use it
70+
csharp_style_var_for_built_in_types = false:silent
71+
csharp_style_var_when_type_is_apparent = false:silent
72+
csharp_style_var_elsewhere = false:silent
73+
74+
# Use language keywords instead of BCL types when generating code, but allow developers to use either
75+
dotnet_style_predefined_type_for_locals_parameters_members = true:silent
76+
dotnet_style_predefined_type_for_member_access = true:silent
77+
78+
# Using directives
79+
dotnet_sort_system_directives_first = true
80+
dotnet_separate_import_directive_groups = true
81+
82+
# Wrapping
83+
csharp_preserve_single_line_blocks = true
84+
csharp_preserve_single_line_statements = false
85+
86+
# Code style
87+
csharp_prefer_braces = true:silent
88+
89+
# Expression-level preferences
90+
dotnet_style_object_initializer = true:suggestion
91+
dotnet_style_collection_initializer = true:suggestion
92+
dotnet_style_explicit_tuple_names = true:suggestion
93+
dotnet_style_coalesce_expression = true:suggestion
94+
dotnet_style_null_propagation = true:suggestion
95+
96+
# Expression-bodied members
97+
csharp_style_expression_bodied_methods = false:silent
98+
csharp_style_expression_bodied_constructors = false:silent
99+
csharp_style_expression_bodied_operators = false:silent
100+
csharp_style_expression_bodied_properties = true:silent
101+
csharp_style_expression_bodied_indexers = true:silent
102+
csharp_style_expression_bodied_accessors = true:silent
103+
104+
# Pattern matching
105+
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
106+
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
107+
csharp_style_inlined_variable_declaration = true:suggestion
108+
109+
# Null checking preferences
110+
csharp_style_throw_expression = true:suggestion
111+
csharp_style_conditional_delegate_call = true:suggestion
112+
113+
# Space preferences
114+
csharp_space_after_cast = false
115+
csharp_space_after_colon_in_inheritance_clause = true
116+
csharp_space_after_comma = true
117+
csharp_space_after_dot = false
118+
csharp_space_after_keywords_in_control_flow_statements = true
119+
csharp_space_after_semicolon_in_for_statement = true
120+
csharp_space_around_binary_operators = before_and_after
121+
csharp_space_around_declaration_statements = do_not_ignore
122+
csharp_space_before_colon_in_inheritance_clause = true
123+
csharp_space_before_comma = false
124+
csharp_space_before_dot = false
125+
csharp_space_before_open_square_brackets = false
126+
csharp_space_before_semicolon_in_for_statement = false
127+
csharp_space_between_empty_square_brackets = false
128+
csharp_space_between_method_call_empty_parameter_list_parentheses = false
129+
csharp_space_between_method_call_name_and_opening_parenthesis = false
130+
csharp_space_between_method_call_parameter_list_parentheses = false
131+
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
132+
csharp_space_between_method_declaration_name_and_open_parenthesis = false
133+
csharp_space_between_method_declaration_parameter_list_parentheses = false
134+
csharp_space_between_parentheses = false
135+
csharp_space_between_square_brackets = false
136+
24137
## Suppressions for ILSpy coding style
138+
139+
# IDE2002:Consecutive braces must not have blank line between them
140+
dotnet_diagnostic.IDE2002.severity = warning
141+
25142
# dotnet_diagnostic.IDE2003.severity = error
26143
dotnet_style_allow_statement_immediately_after_block_experimental = false:warning

ILSpy.Core/MainWindow.xaml.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1202,7 +1202,6 @@ void RefreshCommandExecuted(object sender, ExecutedRoutedEventArgs e)
12021202
} finally {
12031203
refreshInProgress = false;
12041204
}
1205-
12061205
}
12071206

12081207
void SearchCommandExecuted(object sender, ExecutedRoutedEventArgs e)

0 commit comments

Comments
 (0)