Skip to content

Commit e72871e

Browse files
authored
chore: Dotnet editor config and style. (#196)
## Summary Add editor config and reformat files. Subsequent PR will add CI lint check. ## How did you test this change? <!-- Frontend - Leave a screencast or a screenshot to visually describe the changes. --> ## Are there any deployment considerations? <!-- Backend - Do we need to consider migrations or backfilling data? -->
1 parent 24fd77e commit e72871e

File tree

6 files changed

+96
-11
lines changed

6 files changed

+96
-11
lines changed
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
2+
[*]
3+
charset = utf-8
4+
end_of_line = lf
5+
trim_trailing_whitespace = false
6+
insert_final_newline = true
7+
indent_style = space
8+
indent_size = 4
9+
10+
# Microsoft .NET properties
11+
csharp_new_line_before_members_in_object_initializers = false
12+
csharp_preferred_modifier_order = public, private, protected, internal, file, new, static, abstract, virtual, sealed, readonly, override, extern, unsafe, volatile, async, required:suggestion
13+
csharp_style_prefer_utf8_string_literals = true:suggestion
14+
csharp_style_var_elsewhere = true:suggestion
15+
csharp_style_var_for_built_in_types = true:suggestion
16+
csharp_style_var_when_type_is_apparent = true:suggestion
17+
dotnet_naming_rule.unity_serialized_field_rule.import_to_resharper = True
18+
dotnet_naming_rule.unity_serialized_field_rule.resharper_description = Unity serialized field
19+
dotnet_naming_rule.unity_serialized_field_rule.resharper_guid = 5f0fdb63-c892-4d2c-9324-15c80b22a7ef
20+
dotnet_naming_rule.unity_serialized_field_rule.severity = warning
21+
dotnet_naming_rule.unity_serialized_field_rule.style = lower_camel_case_style
22+
dotnet_naming_rule.unity_serialized_field_rule.symbols = unity_serialized_field_symbols
23+
dotnet_naming_style.lower_camel_case_style.capitalization = camel_case
24+
dotnet_naming_symbols.unity_serialized_field_symbols.applicable_accessibilities = *
25+
dotnet_naming_symbols.unity_serialized_field_symbols.applicable_kinds =
26+
dotnet_naming_symbols.unity_serialized_field_symbols.resharper_applicable_kinds = unity_serialised_field
27+
dotnet_naming_symbols.unity_serialized_field_symbols.resharper_required_modifiers = instance
28+
dotnet_style_parentheses_in_arithmetic_binary_operators = never_if_unnecessary:none
29+
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:none
30+
dotnet_style_parentheses_in_relational_binary_operators = never_if_unnecessary:none
31+
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
32+
dotnet_style_predefined_type_for_member_access = true:suggestion
33+
dotnet_style_qualification_for_event = false:suggestion
34+
dotnet_style_qualification_for_field = false:suggestion
35+
dotnet_style_qualification_for_method = false:suggestion
36+
dotnet_style_qualification_for_property = false:suggestion
37+
dotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion
38+
39+
# ReSharper properties
40+
resharper_autodetect_indent_settings = true
41+
resharper_csharp_insert_final_newline = true
42+
resharper_formatter_off_tag = @formatter:off
43+
resharper_formatter_on_tag = @formatter:on
44+
resharper_formatter_tags_enabled = true
45+
resharper_show_autodetect_configure_formatting_tip = false
46+
resharper_use_indent_from_vs = false
47+
resharper_xmldoc_indent_child_elements = RemoveIndent
48+
resharper_xmldoc_indent_text = RemoveIndent
49+
50+
# ReSharper inspection severities
51+
resharper_arrange_redundant_parentheses_highlighting = hint
52+
resharper_arrange_this_qualifier_highlighting = hint
53+
resharper_arrange_type_member_modifiers_highlighting = hint
54+
resharper_arrange_type_modifiers_highlighting = hint
55+
resharper_built_in_type_reference_style_for_member_access_highlighting = hint
56+
resharper_built_in_type_reference_style_highlighting = hint
57+
resharper_foreach_can_be_converted_to_query_using_another_get_enumerator_highlighting = none
58+
resharper_foreach_can_be_partly_converted_to_query_using_another_get_enumerator_highlighting = none
59+
resharper_loop_can_be_converted_to_query_highlighting = none
60+
resharper_mvc_action_not_resolved_highlighting = warning
61+
resharper_mvc_area_not_resolved_highlighting = warning
62+
resharper_mvc_controller_not_resolved_highlighting = warning
63+
resharper_mvc_masterpage_not_resolved_highlighting = warning
64+
resharper_mvc_partial_view_not_resolved_highlighting = warning
65+
resharper_mvc_template_not_resolved_highlighting = warning
66+
resharper_mvc_view_component_not_resolved_highlighting = warning
67+
resharper_mvc_view_component_view_not_resolved_highlighting = warning
68+
resharper_mvc_view_not_resolved_highlighting = warning
69+
resharper_razor_assembly_not_resolved_highlighting = warning
70+
resharper_redundant_base_qualifier_highlighting = warning
71+
resharper_suggest_var_or_type_built_in_types_highlighting = hint
72+
resharper_suggest_var_or_type_elsewhere_highlighting = hint
73+
resharper_suggest_var_or_type_simple_types_highlighting = hint
74+
resharper_web_config_module_not_resolved_highlighting = warning
75+
resharper_web_config_type_not_resolved_highlighting = warning
76+
resharper_web_config_wrong_module_highlighting = warning
77+
78+
[{*.har,*.jsb2,*.jsb3,*.json,*.jsonc,*.postman_collection,*.postman_collection.json,*.postman_environment,*.postman_environment.json,.babelrc,.eslintrc,.prettierrc,.stylelintrc,.ws-context,jest.config}]
79+
indent_style = space
80+
indent_size = 2
81+
82+
[*.{appxmanifest,asax,ascx,aspx,axaml,blockshader,build,c,c++,c++m,cc,ccm,cginc,compute,cp,cpp,cppm,cs,cshtml,cu,cuh,cxx,cxxm,dtd,fs,fsi,fsscript,fsx,fx,fxh,h,h++,hh,hlsl,hlsli,hlslinc,hp,hpp,hxx,icc,inc,inl,ino,ipp,ixx,master,ml,mli,mpp,mq4,mq5,mqh,mxx,nuspec,paml,razor,resw,resx,shader,shaderFoundry,skin,tcc,tpp,urtshader,usf,ush,uxml,vb,xaml,xamlx,xoml,xsd}]
83+
indent_style = space
84+
indent_size = 4
85+
tab_width = 4

sdk/@launchdarkly/observability-dotnet/src/LaunchDarkly.Observability/DefaultNames.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@ public static string MeterNameOrDefault(string meterName)
66
{
77
return string.IsNullOrWhiteSpace(meterName) ? MeterName : meterName;
88
}
9-
9+
1010
public static string ActivitySourceNameOrDefault(string sourceName)
1111
{
1212
return string.IsNullOrWhiteSpace(sourceName) ? ActivitySourceName : sourceName;
1313
}
14-
14+
1515
public static string LoggerNameOrDefault(string name)
1616
{
1717
return string.IsNullOrWhiteSpace(name) ? LoggerName : name;
1818
}
19-
19+
2020
private const string MeterName = "launchdarkly-plugin-default-metrics";
2121
private const string ActivitySourceName = "launchdarkly-plugin-default-activity";
2222
private const string LoggerName = "launchdarkly-plugin-default-logger";

sdk/@launchdarkly/observability-dotnet/src/LaunchDarkly.Observability/ObservabilityConfig.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,17 @@ public struct ObservabilityConfig
4343
/// The LaunchDarkly SDK key.
4444
/// </summary>
4545
public string SdkKey { get; }
46-
46+
4747
/// <summary>
4848
/// Function which extends the configuration of the tracer provider.
4949
/// </summary>
5050
public Action<TracerProviderBuilder> ExtendedTracerConfiguration { get; }
51-
51+
5252
/// <summary>
5353
/// Function which extends the configuration of the logger provider.
5454
/// </summary>
5555
public Action<LoggerProviderBuilder> ExtendedLoggerConfiguration { get; }
56-
56+
5757
/// <summary>
5858
/// Function which extends the configuration of the meter provider.
5959
/// </summary>

sdk/@launchdarkly/observability-dotnet/src/LaunchDarkly.Observability/Sampling/IExportSampler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ internal class SamplingResult
99
public bool Sample { get; set; }
1010
public Dictionary<string, object> Attributes { get; set; } = new Dictionary<string, object>();
1111
}
12-
12+
1313
internal interface IExportSampler
1414
{
1515
SamplingResult SampleSpan(Activity span);

sdk/@launchdarkly/observability-dotnet/test/LaunchDarkly.Observability.Tests/ObservabilityConfigBuilderTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public void WithExtendedTracingConfig_StoresConfigurationAction()
121121
// The action is stored but not executed during build
122122
Assert.That(config.ExtendedTracerConfiguration, Is.Not.Null);
123123
Assert.That(config.ExtendedTracerConfiguration, Is.SameAs(customAction));
124-
124+
125125
// Verify the action hasn't been called yet
126126
Assert.That(wasCalled, Is.False);
127127
Assert.That(capturedBuilder, Is.Null);
@@ -146,7 +146,7 @@ public void WithExtendedLoggerConfiguration_StoresConfigurationAction()
146146
// The action is stored but not executed during build
147147
Assert.That(config.ExtendedLoggerConfiguration, Is.Not.Null);
148148
Assert.That(config.ExtendedLoggerConfiguration, Is.SameAs(customAction));
149-
149+
150150
// Verify the action hasn't been called yet
151151
Assert.That(wasCalled, Is.False);
152152
Assert.That(capturedBuilder, Is.Null);
@@ -171,7 +171,7 @@ public void WithExtendedMeterConfiguration_StoresConfigurationAction()
171171
// The action is stored but not executed during build
172172
Assert.That(config.ExtendedMeterConfiguration, Is.Not.Null);
173173
Assert.That(config.ExtendedMeterConfiguration, Is.SameAs(customAction));
174-
174+
175175
// Verify the action hasn't been called yet
176176
Assert.That(wasCalled, Is.False);
177177
Assert.That(capturedBuilder, Is.Null);

sdk/@launchdarkly/observability-dotnet/test/LaunchDarkly.Observability.Tests/SamplingConfigClientTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ public void Dispose_ShouldDisposeHttpClientIfDisposable()
564564
// Arrange
565565
var mockDisposableHttpClient = new Mock<IHttpClient>();
566566
mockDisposableHttpClient.As<IDisposable>();
567-
567+
568568
var client = new SamplingConfigClient(mockDisposableHttpClient.Object, TestBackendUrl);
569569

570570
// Act

0 commit comments

Comments
 (0)