Skip to content

Commit f968a81

Browse files
chore: initial commit
0 parents  commit f968a81

20 files changed

Lines changed: 1432 additions & 0 deletions

.editorconfig

Lines changed: 306 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,306 @@
1+
# EditorConfig is awesome: https://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
# Don't use tabs for indentation.
7+
[*]
8+
indent_style = space
9+
# (Please don't specify an indent_size here; that has too many unintended consequences.)
10+
11+
# Code files
12+
[*.{cs,csx,vb,vbx}]
13+
indent_size = 4
14+
insert_final_newline = true
15+
charset = utf-8-bom
16+
17+
# XML project files
18+
[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}]
19+
indent_size = 2
20+
21+
# XML config files
22+
[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}]
23+
indent_size = 2
24+
25+
# JSON files
26+
[*.json]
27+
indent_size = 2
28+
29+
# Powershell files
30+
[*.ps1]
31+
indent_size = 2
32+
33+
# Shell script files
34+
[*.sh]
35+
end_of_line = lf
36+
indent_size = 2
37+
38+
# Dotnet code style settings:
39+
[*.{cs,vb}]
40+
41+
# IDE0055: Fix formatting
42+
dotnet_diagnostic.IDE0055.severity = warning
43+
44+
# Sort using and Import directives with System.* appearing first
45+
dotnet_sort_system_directives_first = true
46+
dotnet_separate_import_directive_groups = false
47+
# Avoid "this." and "Me." if not necessary
48+
dotnet_style_qualification_for_field = false:refactoring
49+
dotnet_style_qualification_for_property = false:refactoring
50+
dotnet_style_qualification_for_method = false:refactoring
51+
dotnet_style_qualification_for_event = false:refactoring
52+
53+
# Use language keywords instead of framework type names for type references
54+
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
55+
dotnet_style_predefined_type_for_member_access = true:suggestion
56+
57+
# Suggest more modern language features when available
58+
dotnet_style_object_initializer = true:suggestion
59+
dotnet_style_collection_initializer = true:suggestion
60+
dotnet_style_coalesce_expression = true:suggestion
61+
dotnet_style_null_propagation = true:suggestion
62+
dotnet_style_explicit_tuple_names = true:suggestion
63+
64+
# Whitespace options
65+
dotnet_style_allow_multiple_blank_lines_experimental = false
66+
67+
# Non-private static fields are PascalCase
68+
dotnet_naming_rule.non_private_static_fields_should_be_pascal_case.severity = suggestion
69+
dotnet_naming_rule.non_private_static_fields_should_be_pascal_case.symbols = non_private_static_fields
70+
dotnet_naming_rule.non_private_static_fields_should_be_pascal_case.style = non_private_static_field_style
71+
72+
dotnet_naming_symbols.non_private_static_fields.applicable_kinds = field
73+
dotnet_naming_symbols.non_private_static_fields.applicable_accessibilities = public, protected, internal, protected_internal, private_protected
74+
dotnet_naming_symbols.non_private_static_fields.required_modifiers = static
75+
76+
dotnet_naming_style.non_private_static_field_style.capitalization = pascal_case
77+
78+
# Non-private readonly fields are PascalCase
79+
dotnet_naming_rule.non_private_readonly_fields_should_be_pascal_case.severity = suggestion
80+
dotnet_naming_rule.non_private_readonly_fields_should_be_pascal_case.symbols = non_private_readonly_fields
81+
dotnet_naming_rule.non_private_readonly_fields_should_be_pascal_case.style = non_private_readonly_field_style
82+
83+
dotnet_naming_symbols.non_private_readonly_fields.applicable_kinds = field
84+
dotnet_naming_symbols.non_private_readonly_fields.applicable_accessibilities = public, protected, internal, protected_internal, private_protected
85+
dotnet_naming_symbols.non_private_readonly_fields.required_modifiers = readonly
86+
87+
dotnet_naming_style.non_private_readonly_field_style.capitalization = pascal_case
88+
89+
# Constants are PascalCase
90+
dotnet_naming_rule.constants_should_be_pascal_case.severity = suggestion
91+
dotnet_naming_rule.constants_should_be_pascal_case.symbols = constants
92+
dotnet_naming_rule.constants_should_be_pascal_case.style = constant_style
93+
94+
dotnet_naming_symbols.constants.applicable_kinds = field, local
95+
dotnet_naming_symbols.constants.required_modifiers = const
96+
97+
dotnet_naming_style.constant_style.capitalization = pascal_case
98+
99+
# Static fields are camelCase and start with s_
100+
dotnet_naming_rule.static_fields_should_be_camel_case.severity = suggestion
101+
dotnet_naming_rule.static_fields_should_be_camel_case.symbols = static_fields
102+
dotnet_naming_rule.static_fields_should_be_camel_case.style = static_field_style
103+
104+
dotnet_naming_symbols.static_fields.applicable_kinds = field
105+
dotnet_naming_symbols.static_fields.required_modifiers = static
106+
107+
dotnet_naming_style.static_field_style.capitalization = camel_case
108+
dotnet_naming_style.static_field_style.required_prefix = s_
109+
110+
# Instance fields are camelCase and start with _
111+
dotnet_naming_rule.instance_fields_should_be_camel_case.severity = suggestion
112+
dotnet_naming_rule.instance_fields_should_be_camel_case.symbols = instance_fields
113+
dotnet_naming_rule.instance_fields_should_be_camel_case.style = instance_field_style
114+
115+
dotnet_naming_symbols.instance_fields.applicable_kinds = field
116+
117+
dotnet_naming_style.instance_field_style.capitalization = camel_case
118+
dotnet_naming_style.instance_field_style.required_prefix = _
119+
120+
# Locals and parameters are camelCase
121+
dotnet_naming_rule.locals_should_be_camel_case.severity = suggestion
122+
dotnet_naming_rule.locals_should_be_camel_case.symbols = locals_and_parameters
123+
dotnet_naming_rule.locals_should_be_camel_case.style = camel_case_style
124+
125+
dotnet_naming_symbols.locals_and_parameters.applicable_kinds = parameter, local
126+
127+
dotnet_naming_style.camel_case_style.capitalization = camel_case
128+
129+
# Local functions are PascalCase
130+
dotnet_naming_rule.local_functions_should_be_pascal_case.severity = suggestion
131+
dotnet_naming_rule.local_functions_should_be_pascal_case.symbols = local_functions
132+
dotnet_naming_rule.local_functions_should_be_pascal_case.style = local_function_style
133+
134+
dotnet_naming_symbols.local_functions.applicable_kinds = local_function
135+
136+
dotnet_naming_style.local_function_style.capitalization = pascal_case
137+
138+
# By default, name items with PascalCase
139+
dotnet_naming_rule.members_should_be_pascal_case.severity = suggestion
140+
dotnet_naming_rule.members_should_be_pascal_case.symbols = all_members
141+
dotnet_naming_rule.members_should_be_pascal_case.style = pascal_case_style
142+
143+
dotnet_naming_symbols.all_members.applicable_kinds = *
144+
145+
dotnet_naming_style.pascal_case_style.capitalization = pascal_case
146+
147+
# error RS2008: Enable analyzer release tracking for the analyzer project containing rule '{0}'
148+
dotnet_diagnostic.RS2008.severity = none
149+
150+
# IDE0073: File header
151+
dotnet_diagnostic.IDE0073.severity = warning
152+
file_header_template = Licensed to the Blazor Desktop Contributors under one or more agreements.\nThe Blazor Desktop Contributors licenses this file to you under the MIT license.\nSee the LICENSE file in the project root for more information.
153+
154+
# IDE0035: Remove unreachable code
155+
dotnet_diagnostic.IDE0035.severity = warning
156+
157+
# IDE0036: Order modifiers
158+
dotnet_diagnostic.IDE0036.severity = warning
159+
160+
# IDE0043: Format string contains invalid placeholder
161+
dotnet_diagnostic.IDE0043.severity = warning
162+
163+
# IDE0044: Make field readonly
164+
dotnet_diagnostic.IDE0044.severity = warning
165+
166+
# RS0016: Only enable if API files are present
167+
dotnet_public_api_analyzer.require_api_files = true
168+
169+
# CSharp code style settings:
170+
[*.cs]
171+
# Newline settings
172+
csharp_new_line_before_open_brace = all
173+
csharp_new_line_before_else = true
174+
csharp_new_line_before_catch = true
175+
csharp_new_line_before_finally = true
176+
csharp_new_line_before_members_in_object_initializers = true
177+
csharp_new_line_before_members_in_anonymous_types = true
178+
csharp_new_line_between_query_expression_clauses = true
179+
180+
# Indentation preferences
181+
csharp_indent_block_contents = true
182+
csharp_indent_braces = false
183+
csharp_indent_case_contents = true
184+
csharp_indent_case_contents_when_block = true
185+
csharp_indent_switch_labels = true
186+
csharp_indent_labels = flush_left
187+
188+
# Whitespace options
189+
csharp_style_allow_embedded_statements_on_same_line_experimental = false
190+
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = false
191+
csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = false
192+
193+
# Prefer "var" everywhere
194+
csharp_style_var_for_built_in_types = true:suggestion
195+
csharp_style_var_when_type_is_apparent = true:suggestion
196+
csharp_style_var_elsewhere = true:suggestion
197+
198+
# Prefer method-like constructs to have a block body
199+
csharp_style_expression_bodied_methods = false:none
200+
csharp_style_expression_bodied_constructors = false:none
201+
csharp_style_expression_bodied_operators = false:none
202+
203+
# Prefer property-like constructs to have an expression-body
204+
csharp_style_expression_bodied_properties = true:none
205+
csharp_style_expression_bodied_indexers = true:none
206+
csharp_style_expression_bodied_accessors = true:none
207+
208+
# Suggest more modern language features when available
209+
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
210+
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
211+
csharp_style_inlined_variable_declaration = true:suggestion
212+
csharp_style_throw_expression = true:suggestion
213+
csharp_style_conditional_delegate_call = true:suggestion
214+
215+
# Space preferences
216+
csharp_space_after_cast = false
217+
csharp_space_after_colon_in_inheritance_clause = true
218+
csharp_space_after_comma = true
219+
csharp_space_after_dot = false
220+
csharp_space_after_keywords_in_control_flow_statements = true
221+
csharp_space_after_semicolon_in_for_statement = true
222+
csharp_space_around_binary_operators = before_and_after
223+
csharp_space_around_declaration_statements = do_not_ignore
224+
csharp_space_before_colon_in_inheritance_clause = true
225+
csharp_space_before_comma = false
226+
csharp_space_before_dot = false
227+
csharp_space_before_open_square_brackets = false
228+
csharp_space_before_semicolon_in_for_statement = false
229+
csharp_space_between_empty_square_brackets = false
230+
csharp_space_between_method_call_empty_parameter_list_parentheses = false
231+
csharp_space_between_method_call_name_and_opening_parenthesis = false
232+
csharp_space_between_method_call_parameter_list_parentheses = false
233+
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
234+
csharp_space_between_method_declaration_name_and_open_parenthesis = false
235+
csharp_space_between_method_declaration_parameter_list_parentheses = false
236+
csharp_space_between_parentheses = false
237+
csharp_space_between_square_brackets = false
238+
239+
# Blocks are allowed
240+
csharp_prefer_braces = true:silent
241+
csharp_preserve_single_line_blocks = true
242+
csharp_preserve_single_line_statements = true
243+
244+
# Currently only enabled for C# due to crash in VB analyzer. VB can be enabled once
245+
# https://github.com/dotnet/roslyn/pull/54259 has been published.
246+
dotnet_style_allow_statement_immediately_after_block_experimental = false
247+
248+
[src/CodeStyle/**.{cs,vb}]
249+
# warning RS0005: Do not use generic CodeAction.Create to create CodeAction
250+
dotnet_diagnostic.RS0005.severity = none
251+
252+
[src/{Analyzers,CodeStyle,Features,Workspaces,EditorFeatures,VisualStudio}/**/*.{cs,vb}]
253+
254+
# IDE0011: Add braces
255+
csharp_prefer_braces = when_multiline:warning
256+
# NOTE: We need the below severity entry for Add Braces due to https://github.com/dotnet/roslyn/issues/44201
257+
dotnet_diagnostic.IDE0011.severity = warning
258+
259+
# IDE0040: Add accessibility modifiers
260+
dotnet_diagnostic.IDE0040.severity = warning
261+
262+
# CONSIDER: Are IDE0051 and IDE0052 too noisy to be warnings for IDE editing scenarios? Should they be made build-only warnings?
263+
# IDE0051: Remove unused private member
264+
dotnet_diagnostic.IDE0051.severity = warning
265+
266+
# IDE0052: Remove unread private member
267+
dotnet_diagnostic.IDE0052.severity = warning
268+
269+
# IDE0059: Unnecessary assignment to a value
270+
dotnet_diagnostic.IDE0059.severity = warning
271+
272+
# IDE0060: Remove unused parameter
273+
dotnet_diagnostic.IDE0060.severity = warning
274+
275+
# CA1012: Abstract types should not have public constructors
276+
dotnet_diagnostic.CA1012.severity = warning
277+
278+
# CA1822: Make member static
279+
dotnet_diagnostic.CA1822.severity = warning
280+
281+
# Prefer "var" everywhere
282+
dotnet_diagnostic.IDE0007.severity = warning
283+
csharp_style_var_for_built_in_types = true:warning
284+
csharp_style_var_when_type_is_apparent = true:warning
285+
csharp_style_var_elsewhere = true:warning
286+
287+
# dotnet_style_allow_multiple_blank_lines_experimental
288+
dotnet_diagnostic.IDE2000.severity = warning
289+
290+
# csharp_style_allow_embedded_statements_on_same_line_experimental
291+
dotnet_diagnostic.IDE2001.severity = warning
292+
293+
# csharp_style_allow_blank_lines_between_consecutive_braces_experimental
294+
dotnet_diagnostic.IDE2002.severity = warning
295+
296+
# dotnet_style_allow_statement_immediately_after_block_experimental
297+
dotnet_diagnostic.IDE2003.severity = warning
298+
299+
# csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental
300+
dotnet_diagnostic.IDE2004.severity = warning
301+
302+
[src/{VisualStudio}/**/*.{cs,vb}]
303+
# CA1822: Make member static
304+
# Not enforced as a build 'warning' for 'VisualStudio' layer due to large number of false positives from https://github.com/dotnet/roslyn-analyzers/issues/3857 and https://github.com/dotnet/roslyn-analyzers/issues/3858
305+
# Additionally, there is a risk of accidentally breaking an internal API that partners rely on though IVT.
306+
dotnet_diagnostic.CA1822.severity = suggestion

.gitattributes

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
###############################################################################
2+
# Set default behavior to automatically normalize line endings.
3+
###############################################################################
4+
* text=auto
5+
6+
###############################################################################
7+
# Set default behavior for command prompt diff.
8+
#
9+
# This is need for earlier builds of msysgit that does not have it on by
10+
# default for csharp files.
11+
# Note: This is only used by command line
12+
###############################################################################
13+
#*.cs diff=csharp
14+
15+
###############################################################################
16+
# Set the merge driver for project and solution files
17+
#
18+
# Merging from the command prompt will add diff markers to the files if there
19+
# are conflicts (Merging from VS is not affected by the settings below, in VS
20+
# the diff markers are never inserted). Diff markers may cause the following
21+
# file extensions to fail to load in VS. An alternative would be to treat
22+
# these files as binary and thus will always conflict and require user
23+
# intervention with every merge. To do so, just uncomment the entries below
24+
###############################################################################
25+
#*.sln merge=binary
26+
#*.csproj merge=binary
27+
#*.vbproj merge=binary
28+
#*.vcxproj merge=binary
29+
#*.vcproj merge=binary
30+
#*.dbproj merge=binary
31+
#*.fsproj merge=binary
32+
#*.lsproj merge=binary
33+
#*.wixproj merge=binary
34+
#*.modelproj merge=binary
35+
#*.sqlproj merge=binary
36+
#*.wwaproj merge=binary
37+
38+
###############################################################################
39+
# behavior for image files
40+
#
41+
# image files are treated as binary by default.
42+
###############################################################################
43+
#*.jpg binary
44+
#*.png binary
45+
#*.gif binary
46+
47+
###############################################################################
48+
# diff behavior for common document formats
49+
#
50+
# Convert binary document formats to text before diffing them. This feature
51+
# is only available from the command line. Turn it on by uncommenting the
52+
# entries below.
53+
###############################################################################
54+
#*.doc diff=astextplain
55+
#*.DOC diff=astextplain
56+
#*.docx diff=astextplain
57+
#*.DOCX diff=astextplain
58+
#*.dot diff=astextplain
59+
#*.DOT diff=astextplain
60+
#*.pdf diff=astextplain
61+
#*.PDF diff=astextplain
62+
#*.rtf diff=astextplain
63+
#*.RTF diff=astextplain

0 commit comments

Comments
 (0)