Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 85 additions & 0 deletions sdk/@launchdarkly/observability-dotnet/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@

[*]
charset = utf-8
end_of_line = lf
trim_trailing_whitespace = false
insert_final_newline = true
indent_style = space
indent_size = 4

# Microsoft .NET properties
csharp_new_line_before_members_in_object_initializers = false
csharp_preferred_modifier_order = public, private, protected, internal, file, new, static, abstract, virtual, sealed, readonly, override, extern, unsafe, volatile, async, required:suggestion
csharp_style_prefer_utf8_string_literals = true:suggestion
csharp_style_var_elsewhere = true:suggestion
csharp_style_var_for_built_in_types = true:suggestion
csharp_style_var_when_type_is_apparent = true:suggestion
dotnet_naming_rule.unity_serialized_field_rule.import_to_resharper = True
dotnet_naming_rule.unity_serialized_field_rule.resharper_description = Unity serialized field
dotnet_naming_rule.unity_serialized_field_rule.resharper_guid = 5f0fdb63-c892-4d2c-9324-15c80b22a7ef
dotnet_naming_rule.unity_serialized_field_rule.severity = warning
dotnet_naming_rule.unity_serialized_field_rule.style = lower_camel_case_style
dotnet_naming_rule.unity_serialized_field_rule.symbols = unity_serialized_field_symbols
dotnet_naming_style.lower_camel_case_style.capitalization = camel_case
dotnet_naming_symbols.unity_serialized_field_symbols.applicable_accessibilities = *
dotnet_naming_symbols.unity_serialized_field_symbols.applicable_kinds =
dotnet_naming_symbols.unity_serialized_field_symbols.resharper_applicable_kinds = unity_serialised_field
dotnet_naming_symbols.unity_serialized_field_symbols.resharper_required_modifiers = instance
dotnet_style_parentheses_in_arithmetic_binary_operators = never_if_unnecessary:none
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:none
dotnet_style_parentheses_in_relational_binary_operators = never_if_unnecessary:none
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
dotnet_style_predefined_type_for_member_access = true:suggestion
dotnet_style_qualification_for_event = false:suggestion
dotnet_style_qualification_for_field = false:suggestion
dotnet_style_qualification_for_method = false:suggestion
dotnet_style_qualification_for_property = false:suggestion
dotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion

# ReSharper properties
resharper_autodetect_indent_settings = true
resharper_csharp_insert_final_newline = true
resharper_formatter_off_tag = @formatter:off
resharper_formatter_on_tag = @formatter:on
resharper_formatter_tags_enabled = true
resharper_show_autodetect_configure_formatting_tip = false
resharper_use_indent_from_vs = false
resharper_xmldoc_indent_child_elements = RemoveIndent
resharper_xmldoc_indent_text = RemoveIndent

# ReSharper inspection severities
resharper_arrange_redundant_parentheses_highlighting = hint
resharper_arrange_this_qualifier_highlighting = hint
resharper_arrange_type_member_modifiers_highlighting = hint
resharper_arrange_type_modifiers_highlighting = hint
resharper_built_in_type_reference_style_for_member_access_highlighting = hint
resharper_built_in_type_reference_style_highlighting = hint
resharper_foreach_can_be_converted_to_query_using_another_get_enumerator_highlighting = none
resharper_foreach_can_be_partly_converted_to_query_using_another_get_enumerator_highlighting = none
resharper_loop_can_be_converted_to_query_highlighting = none
resharper_mvc_action_not_resolved_highlighting = warning
resharper_mvc_area_not_resolved_highlighting = warning
resharper_mvc_controller_not_resolved_highlighting = warning
resharper_mvc_masterpage_not_resolved_highlighting = warning
resharper_mvc_partial_view_not_resolved_highlighting = warning
resharper_mvc_template_not_resolved_highlighting = warning
resharper_mvc_view_component_not_resolved_highlighting = warning
resharper_mvc_view_component_view_not_resolved_highlighting = warning
resharper_mvc_view_not_resolved_highlighting = warning
resharper_razor_assembly_not_resolved_highlighting = warning
resharper_redundant_base_qualifier_highlighting = warning
resharper_suggest_var_or_type_built_in_types_highlighting = hint
resharper_suggest_var_or_type_elsewhere_highlighting = hint
resharper_suggest_var_or_type_simple_types_highlighting = hint
resharper_web_config_module_not_resolved_highlighting = warning
resharper_web_config_type_not_resolved_highlighting = warning
resharper_web_config_wrong_module_highlighting = warning

[{*.har,*.jsb2,*.jsb3,*.json,*.jsonc,*.postman_collection,*.postman_collection.json,*.postman_environment,*.postman_environment.json,.babelrc,.eslintrc,.prettierrc,.stylelintrc,.ws-context,jest.config}]
indent_style = space
indent_size = 2

[*.{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}]
indent_style = space
indent_size = 4
tab_width = 4
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ public static string MeterNameOrDefault(string meterName)
{
return string.IsNullOrWhiteSpace(meterName) ? MeterName : meterName;
}

public static string ActivitySourceNameOrDefault(string sourceName)
{
return string.IsNullOrWhiteSpace(sourceName) ? ActivitySourceName : sourceName;
}

public static string LoggerNameOrDefault(string name)
{
return string.IsNullOrWhiteSpace(name) ? LoggerName : name;
}

private const string MeterName = "launchdarkly-plugin-default-metrics";
private const string ActivitySourceName = "launchdarkly-plugin-default-activity";
private const string LoggerName = "launchdarkly-plugin-default-logger";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,17 @@ public struct ObservabilityConfig
/// The LaunchDarkly SDK key.
/// </summary>
public string SdkKey { get; }

/// <summary>
/// Function which extends the configuration of the tracer provider.
/// </summary>
public Action<TracerProviderBuilder> ExtendedTracerConfiguration { get; }

/// <summary>
/// Function which extends the configuration of the logger provider.
/// </summary>
public Action<LoggerProviderBuilder> ExtendedLoggerConfiguration { get; }

/// <summary>
/// Function which extends the configuration of the meter provider.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ internal class SamplingResult
public bool Sample { get; set; }
public Dictionary<string, object> Attributes { get; set; } = new Dictionary<string, object>();
}

internal interface IExportSampler
{
SamplingResult SampleSpan(Activity span);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public void WithExtendedTracingConfig_StoresConfigurationAction()
// The action is stored but not executed during build
Assert.That(config.ExtendedTracerConfiguration, Is.Not.Null);
Assert.That(config.ExtendedTracerConfiguration, Is.SameAs(customAction));

// Verify the action hasn't been called yet
Assert.That(wasCalled, Is.False);
Assert.That(capturedBuilder, Is.Null);
Expand All @@ -146,7 +146,7 @@ public void WithExtendedLoggerConfiguration_StoresConfigurationAction()
// The action is stored but not executed during build
Assert.That(config.ExtendedLoggerConfiguration, Is.Not.Null);
Assert.That(config.ExtendedLoggerConfiguration, Is.SameAs(customAction));

// Verify the action hasn't been called yet
Assert.That(wasCalled, Is.False);
Assert.That(capturedBuilder, Is.Null);
Expand All @@ -171,7 +171,7 @@ public void WithExtendedMeterConfiguration_StoresConfigurationAction()
// The action is stored but not executed during build
Assert.That(config.ExtendedMeterConfiguration, Is.Not.Null);
Assert.That(config.ExtendedMeterConfiguration, Is.SameAs(customAction));

// Verify the action hasn't been called yet
Assert.That(wasCalled, Is.False);
Assert.That(capturedBuilder, Is.Null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ public void Dispose_ShouldDisposeHttpClientIfDisposable()
// Arrange
var mockDisposableHttpClient = new Mock<IHttpClient>();
mockDisposableHttpClient.As<IDisposable>();

var client = new SamplingConfigClient(mockDisposableHttpClient.Object, TestBackendUrl);

// Act
Expand Down
Loading