Skip to content

Commit 6e2047c

Browse files
authored
chore: add editorconfig (#240)
1 parent 8b68557 commit 6e2047c

5 files changed

Lines changed: 240 additions & 43 deletions

File tree

.editorconfig

Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = crlf
5+
indent_style = space
6+
indent_size = 4
7+
tab_width = 4
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
file_header_template = Copyright (c) 2026 Foundry Project. Licensed under the MIT License.\nSee the LICENSE file in the project root for more information.
11+
12+
[*{_AssemblyInfo.cs,.g.cs,.g.i.cs,.designer.cs,.Designer.cs}]
13+
generated_code = true
14+
15+
[*.{json,yml,yaml}]
16+
indent_size = 2
17+
18+
[*.{csproj,props,targets,xml,resx,resw,slnx,appxmanifest,manifest}]
19+
indent_size = 2
20+
21+
[*.xaml]
22+
indent_size = 4
23+
24+
[*.md]
25+
indent_size = 2
26+
trim_trailing_whitespace = false
27+
28+
[*.ps1]
29+
indent_size = 4
30+
31+
[*.cs]
32+
csharp_using_directive_placement = outside_namespace:silent
33+
csharp_style_namespace_declarations = file_scoped:suggestion
34+
dotnet_code_quality_unused_parameters = all:suggestion
35+
36+
dotnet_style_qualification_for_event = false:silent
37+
dotnet_style_qualification_for_field = false:silent
38+
dotnet_style_qualification_for_method = false:silent
39+
dotnet_style_qualification_for_property = false:silent
40+
dotnet_style_predefined_type_for_locals_parameters_members = true:silent
41+
dotnet_style_predefined_type_for_member_access = true:silent
42+
dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent
43+
44+
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
45+
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
46+
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
47+
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
48+
49+
dotnet_style_coalesce_expression = true:suggestion
50+
dotnet_style_collection_initializer = true:suggestion
51+
dotnet_style_explicit_tuple_names = true:suggestion
52+
dotnet_style_null_propagation = true:suggestion
53+
dotnet_style_object_initializer = true:suggestion
54+
dotnet_style_prefer_auto_properties = true:silent
55+
dotnet_style_prefer_collection_expression = true:suggestion
56+
dotnet_style_prefer_compound_assignment = true:suggestion
57+
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
58+
dotnet_style_prefer_conditional_expression_over_return = true:silent
59+
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
60+
dotnet_style_prefer_inferred_tuple_names = true:suggestion
61+
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
62+
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
63+
dotnet_style_prefer_simplified_interpolation = true:suggestion
64+
dotnet_style_readonly_field = true:suggestion
65+
66+
csharp_style_var_for_built_in_types = false:silent
67+
csharp_style_var_when_type_is_apparent = true:silent
68+
csharp_style_var_elsewhere = false:silent
69+
csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion
70+
csharp_style_prefer_collection_expression = true:suggestion
71+
csharp_style_prefer_index_operator = true:suggestion
72+
csharp_style_prefer_range_operator = true:suggestion
73+
csharp_style_prefer_tuple_swap = true:suggestion
74+
csharp_style_deconstructed_variable_declaration = true:suggestion
75+
csharp_style_inlined_variable_declaration = true:suggestion
76+
csharp_style_throw_expression = true:suggestion
77+
78+
csharp_style_expression_bodied_accessors = false:silent
79+
csharp_style_expression_bodied_constructors = false:silent
80+
csharp_style_expression_bodied_indexers = false:silent
81+
csharp_style_expression_bodied_lambdas = true:silent
82+
csharp_style_expression_bodied_local_functions = false:silent
83+
csharp_style_expression_bodied_methods = false:silent
84+
csharp_style_expression_bodied_operators = false:silent
85+
csharp_style_expression_bodied_properties = false:silent
86+
87+
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
88+
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
89+
csharp_style_prefer_extended_property_pattern = true:suggestion
90+
csharp_style_prefer_not_pattern = true:suggestion
91+
csharp_style_prefer_pattern_matching = true:suggestion
92+
csharp_style_prefer_switch_expression = true:suggestion
93+
csharp_style_conditional_delegate_call = true:suggestion
94+
csharp_prefer_simple_default_expression = true:suggestion
95+
csharp_prefer_static_local_function = true:suggestion
96+
csharp_prefer_braces = true:suggestion
97+
csharp_preferred_modifier_order = public,private,protected,internal,file,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,required,volatile,async
98+
99+
csharp_new_line_before_catch = true
100+
csharp_new_line_before_else = true
101+
csharp_new_line_before_finally = true
102+
csharp_new_line_before_members_in_anonymous_types = true
103+
csharp_new_line_before_members_in_object_initializers = true
104+
csharp_new_line_before_open_brace = all
105+
csharp_new_line_between_query_expression_clauses = true
106+
107+
csharp_indent_block_contents = true
108+
csharp_indent_braces = false
109+
csharp_indent_case_contents = true
110+
csharp_indent_case_contents_when_block = false
111+
csharp_indent_labels = no_change
112+
csharp_indent_switch_labels = true
113+
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 = false
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+
137+
csharp_preserve_single_line_blocks = true
138+
csharp_preserve_single_line_statements = true
139+
140+
dotnet_naming_symbols.interface_types.applicable_kinds = interface
141+
dotnet_naming_style.interface_prefix.capitalization = pascal_case
142+
dotnet_naming_style.interface_prefix.required_prefix = I
143+
dotnet_naming_rule.interface_types_should_be_prefixed.symbols = interface_types
144+
dotnet_naming_rule.interface_types_should_be_prefixed.style = interface_prefix
145+
dotnet_naming_rule.interface_types_should_be_prefixed.severity = suggestion
146+
147+
dotnet_naming_symbols.async_methods.applicable_kinds = method
148+
dotnet_naming_symbols.async_methods.applicable_accessibilities = *
149+
dotnet_naming_symbols.async_methods.required_modifiers = async
150+
dotnet_naming_style.async_suffix.capitalization = pascal_case
151+
dotnet_naming_style.async_suffix.required_suffix = Async
152+
dotnet_naming_rule.async_methods_should_end_in_async.symbols = async_methods
153+
dotnet_naming_rule.async_methods_should_end_in_async.style = async_suffix
154+
dotnet_naming_rule.async_methods_should_end_in_async.severity = suggestion
155+
156+
dotnet_naming_symbols.constant_fields.applicable_kinds = field
157+
dotnet_naming_symbols.constant_fields.required_modifiers = const
158+
dotnet_naming_style.pascal_case.capitalization = pascal_case
159+
dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields
160+
dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case
161+
dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion
162+
163+
dotnet_naming_symbols.private_fields.applicable_kinds = field
164+
dotnet_naming_symbols.private_fields.applicable_accessibilities = private
165+
dotnet_naming_symbols.private_fields.required_modifiers =
166+
dotnet_naming_style.private_field_prefix.capitalization = camel_case
167+
dotnet_naming_style.private_field_prefix.required_prefix = _
168+
dotnet_naming_rule.private_fields_should_be_prefixed.symbols = private_fields
169+
dotnet_naming_rule.private_fields_should_be_prefixed.style = private_field_prefix
170+
dotnet_naming_rule.private_fields_should_be_prefixed.severity = suggestion

.gitattributes

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
* text=auto
2+
3+
*.cs text eol=crlf
4+
*.xaml text eol=crlf
5+
*.csproj text eol=crlf
6+
*.props text eol=crlf
7+
*.targets text eol=crlf
8+
*.slnx text eol=crlf
9+
*.xml text eol=crlf
10+
*.resx text eol=crlf
11+
*.resw text eol=crlf
12+
*.json text eol=crlf
13+
*.yml text eol=crlf
14+
*.yaml text eol=crlf
15+
*.md text eol=crlf
16+
*.ps1 text eol=crlf
17+
*.txt text eol=crlf
18+
*.ini text eol=crlf
19+
*.reg text eol=crlf
20+
21+
*.png binary
22+
*.ico binary
23+
*.exe binary
24+
*.dll binary
25+
*.wim binary
26+
*.zip binary
27+
*.7z binary

src/Foundry.Connect/Services/Network/NativeWifiApi.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,15 @@ public static IReadOnlyList<WifiNetworkSummary> GetAvailableNetworks()
5353
List<Guid> interfaceIds = ReadInterfaceIds(interfaceListPointer);
5454
Dictionary<string, WifiNetworkSummary> networks = new(StringComparer.OrdinalIgnoreCase);
5555

56-
foreach (Guid interfaceId in interfaceIds)
57-
{
58-
IReadOnlyList<WifiNetworkSummary> interfaceNetworks = ReadAvailableNetworks(clientHandle, interfaceId);
59-
TryStartScan(clientHandle, interfaceId);
60-
61-
foreach (WifiNetworkSummary network in interfaceNetworks)
56+
foreach (Guid interfaceId in interfaceIds)
6257
{
63-
if (networks.TryGetValue(network.Ssid, out WifiNetworkSummary? existing) &&
64-
existing.SignalStrengthPercent >= network.SignalStrengthPercent)
58+
IReadOnlyList<WifiNetworkSummary> interfaceNetworks = ReadAvailableNetworks(clientHandle, interfaceId);
59+
TryStartScan(clientHandle, interfaceId);
60+
61+
foreach (WifiNetworkSummary network in interfaceNetworks)
62+
{
63+
if (networks.TryGetValue(network.Ssid, out WifiNetworkSummary? existing) &&
64+
existing.SignalStrengthPercent >= network.SignalStrengthPercent)
6565
{
6666
continue;
6767
}

src/Foundry.Connect/ViewModels/MainWindowViewModel.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -601,16 +601,16 @@ private async Task TrackSessionReadyAsync(NetworkStatusSnapshot snapshot, Cancel
601601
string wifiSecurity = ResolveWifiSecurity(snapshot, connectionType);
602602
string wifiSource = ResolveWifiSource(snapshot, connectionType);
603603
var properties = new Dictionary<string, object?>
604-
{
605-
["connect_network_connection_type"] = connectionType,
606-
["connect_network_layout_mode"] = NetworkTelemetryClassifier.ClassifyLayout(snapshot.LayoutMode),
607-
["connect_ethernet_available"] = snapshot.HasEthernetAdapter,
608-
["connect_wifi_available"] = snapshot.HasWirelessAdapter && snapshot.IsWifiRuntimeAvailable,
609-
["connect_wifi_security_type"] = wifiSecurity,
610-
["connect_wifi_source"] = wifiSource,
611-
["connect_wired_dot1x_enabled"] = _configuration.Dot1x.IsEnabled,
612-
["connect_wifi_provisioned"] = HasProvisionedWifiProfile
613-
};
604+
{
605+
["connect_network_connection_type"] = connectionType,
606+
["connect_network_layout_mode"] = NetworkTelemetryClassifier.ClassifyLayout(snapshot.LayoutMode),
607+
["connect_ethernet_available"] = snapshot.HasEthernetAdapter,
608+
["connect_wifi_available"] = snapshot.HasWirelessAdapter && snapshot.IsWifiRuntimeAvailable,
609+
["connect_wifi_security_type"] = wifiSecurity,
610+
["connect_wifi_source"] = wifiSource,
611+
["connect_wired_dot1x_enabled"] = _configuration.Dot1x.IsEnabled,
612+
["connect_wifi_provisioned"] = HasProvisionedWifiProfile
613+
};
614614

615615
_logger.LogDebug(
616616
"Tracking Connect session-ready telemetry event. ConnectionType={ConnectionType}, LayoutMode={LayoutMode}, WifiSecurity={WifiSecurity}, WifiSource={WifiSource}, WiredDot1xEnabled={WiredDot1xEnabled}, WifiProvisioned={WifiProvisioned}.",

src/Foundry.Deploy/Services/Deployment/DeploymentOrchestrator.cs

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -271,31 +271,31 @@ private Task TrackDeploymentCompletedAsync(
271271
{
272272
HardwareProfile? hardware = runtimeState?.HardwareProfile;
273273
var properties = new Dictionary<string, object?>
274-
{
275-
["deploy_session_success"] = success,
276-
["deploy_session_cancelled"] = cancelled,
277-
["deploy_session_duration_seconds"] = Math.Round(duration.TotalSeconds, 2),
278-
["deploy_session_completed_step_count"] = runtimeState?.CompletedSteps.Count ?? 0,
279-
["deploy_session_failed_step_name"] = failedStepName,
280-
["deploy_session_mode"] = context.Mode.ToString().ToLowerInvariant(),
281-
["deploy_session_dry_run_enabled"] = context.IsDryRun,
282-
["deploy_hardware_vendor"] = NormalizeTelemetryString(hardware?.Manufacturer),
283-
["deploy_hardware_model"] = NormalizeTelemetryString(hardware?.Model),
284-
["deploy_hardware_virtual_machine"] = hardware?.IsVirtualMachine ?? false,
285-
["deploy_os_product"] = ResolveOperatingSystemProduct(context.OperatingSystem),
286-
["deploy_os_version"] = NormalizeTelemetryString(context.OperatingSystem.ReleaseId),
287-
["deploy_os_build"] = NormalizeTelemetryString(context.OperatingSystem.Build),
288-
["deploy_os_architecture"] = NormalizeTelemetryString(context.OperatingSystem.Architecture),
289-
["deploy_os_language"] = NormalizeTelemetryString(context.OperatingSystem.LanguageCode),
290-
["deploy_driver_pack_selection_kind"] = context.DriverPackSelectionKind.ToString().ToLowerInvariant(),
291-
["deploy_driver_pack_vendor"] = NormalizeTelemetryString(context.DriverPack?.Manufacturer, "none"),
292-
["deploy_driver_pack_model"] = ResolveDriverPackCatalogModel(context.DriverPack),
293-
["deploy_firmware_updates_enabled"] = context.ApplyFirmwareUpdates,
294-
["deploy_autopilot_enabled"] = context.IsAutopilotEnabled,
295-
["deploy_autopilot_provisioning_mode"] = NormalizeTelemetryString(ResolveAutopilotProvisioningMode(context)),
296-
["deploy_autopilot_hash_upload_state"] = NormalizeTelemetryString(runtimeState?.AutopilotHardwareHashUploadState.ToString()),
297-
["deploy_autopilot_hash_group_tag_selected"] = !string.IsNullOrWhiteSpace(runtimeState?.AutopilotHardwareHashGroupTag)
298-
};
274+
{
275+
["deploy_session_success"] = success,
276+
["deploy_session_cancelled"] = cancelled,
277+
["deploy_session_duration_seconds"] = Math.Round(duration.TotalSeconds, 2),
278+
["deploy_session_completed_step_count"] = runtimeState?.CompletedSteps.Count ?? 0,
279+
["deploy_session_failed_step_name"] = failedStepName,
280+
["deploy_session_mode"] = context.Mode.ToString().ToLowerInvariant(),
281+
["deploy_session_dry_run_enabled"] = context.IsDryRun,
282+
["deploy_hardware_vendor"] = NormalizeTelemetryString(hardware?.Manufacturer),
283+
["deploy_hardware_model"] = NormalizeTelemetryString(hardware?.Model),
284+
["deploy_hardware_virtual_machine"] = hardware?.IsVirtualMachine ?? false,
285+
["deploy_os_product"] = ResolveOperatingSystemProduct(context.OperatingSystem),
286+
["deploy_os_version"] = NormalizeTelemetryString(context.OperatingSystem.ReleaseId),
287+
["deploy_os_build"] = NormalizeTelemetryString(context.OperatingSystem.Build),
288+
["deploy_os_architecture"] = NormalizeTelemetryString(context.OperatingSystem.Architecture),
289+
["deploy_os_language"] = NormalizeTelemetryString(context.OperatingSystem.LanguageCode),
290+
["deploy_driver_pack_selection_kind"] = context.DriverPackSelectionKind.ToString().ToLowerInvariant(),
291+
["deploy_driver_pack_vendor"] = NormalizeTelemetryString(context.DriverPack?.Manufacturer, "none"),
292+
["deploy_driver_pack_model"] = ResolveDriverPackCatalogModel(context.DriverPack),
293+
["deploy_firmware_updates_enabled"] = context.ApplyFirmwareUpdates,
294+
["deploy_autopilot_enabled"] = context.IsAutopilotEnabled,
295+
["deploy_autopilot_provisioning_mode"] = NormalizeTelemetryString(ResolveAutopilotProvisioningMode(context)),
296+
["deploy_autopilot_hash_upload_state"] = NormalizeTelemetryString(runtimeState?.AutopilotHardwareHashUploadState.ToString()),
297+
["deploy_autopilot_hash_group_tag_selected"] = !string.IsNullOrWhiteSpace(runtimeState?.AutopilotHardwareHashGroupTag)
298+
};
299299

300300
_logger.LogDebug(
301301
"Tracking deployment telemetry event. Success={Success}, Cancelled={Cancelled}, DurationSeconds={DurationSeconds}, CompletedStepCount={CompletedStepCount}, FailedStepName={FailedStepName}, Mode={Mode}, IsDryRun={IsDryRun}, HardwareVendor={HardwareVendor}, HardwareModel={HardwareModel}, OsProduct={OsProduct}, OsVersion={OsVersion}, DriverPackSelectionKind={DriverPackSelectionKind}, DriverPackVendor={DriverPackVendor}, DriverPackModel={DriverPackModel}.",

0 commit comments

Comments
 (0)