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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
89 changes: 80 additions & 9 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,40 @@ root = true
insert_final_newline = true
indent_style = space
indent_size = 4
dotnet_diagnostic.CA1027.severity=error
dotnet_diagnostic.CA1062.severity=error
dotnet_diagnostic.CA1064.severity=error
dotnet_diagnostic.CA1066.severity=error
dotnet_diagnostic.CA1067.severity=error
dotnet_diagnostic.CA1068.severity=error
dotnet_diagnostic.CA1069.severity=warning
dotnet_diagnostic.CA2013.severity=error
dotnet_diagnostic.CA1802.severity=error
dotnet_diagnostic.CA1813.severity=error
dotnet_diagnostic.CA1814.severity=error
dotnet_diagnostic.CA1815.severity=error
dotnet_diagnostic.CA1822.severity=error
dotnet_diagnostic.CA1827.severity=error
dotnet_diagnostic.CA1828.severity=error
dotnet_diagnostic.CA1826.severity=error
dotnet_diagnostic.CA1829.severity=error
dotnet_diagnostic.CA1830.severity=error
dotnet_diagnostic.CA1831.severity=error
dotnet_diagnostic.CA1832.severity=error
dotnet_diagnostic.CA1833.severity=error
dotnet_diagnostic.CA1834.severity=error
dotnet_diagnostic.CA1835.severity=error
dotnet_diagnostic.CA1836.severity=error
dotnet_diagnostic.CA1837.severity=error
dotnet_diagnostic.CA1838.severity=error
dotnet_diagnostic.CA2015.severity=error
dotnet_diagnostic.CA2012.severity=error
dotnet_diagnostic.CA2011.severity=error
dotnet_diagnostic.CA2009.severity=error
dotnet_diagnostic.CA2008.severity=error
dotnet_diagnostic.CA2007.severity=warning
dotnet_diagnostic.CA2000.severity=suggestion

[project.json]
indent_size = 2

Expand Down Expand Up @@ -58,14 +92,14 @@ dotnet_naming_symbols.constant_fields.applicable_kinds = field
dotnet_naming_symbols.constant_fields.required_modifiers = const
dotnet_naming_style.pascal_case_style.capitalization = pascal_case

# static fields should have _ prefix
# static fields should have s_ prefix
dotnet_naming_rule.static_fields_should_have_prefix.severity = suggestion
dotnet_naming_rule.static_fields_should_have_prefix.symbols = static_fields
dotnet_naming_rule.static_fields_should_have_prefix.style = static_prefix_style
dotnet_naming_symbols.static_fields.applicable_kinds = field
dotnet_naming_symbols.static_fields.required_modifiers = static
dotnet_naming_symbols.static_fields.applicable_accessibilities = private, internal, private_protected
dotnet_naming_style.static_prefix_style.required_prefix = _
dotnet_naming_style.static_prefix_style.required_prefix = s_
dotnet_naming_style.static_prefix_style.capitalization = camel_case

# internal and private fields should be _camelCase
Expand All @@ -80,7 +114,7 @@ dotnet_naming_style.camel_case_underscore_style.capitalization = camel_case
# Code style defaults
csharp_using_directive_placement = outside_namespace:suggestion
dotnet_sort_system_directives_first = true
csharp_prefer_braces = true:suggestion
csharp_prefer_braces = true:silent
csharp_preserve_single_line_blocks = true:none
csharp_preserve_single_line_statements = false:none
csharp_prefer_static_local_function = true:suggestion
Expand All @@ -101,8 +135,8 @@ dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggesti
dotnet_style_prefer_inferred_tuple_names = true:suggestion
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
dotnet_style_prefer_auto_properties = true:suggestion
dotnet_style_prefer_conditional_expression_over_assignment = true:suggestion
dotnet_style_prefer_conditional_expression_over_return = true:suggestion
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
dotnet_style_prefer_conditional_expression_over_return = true:silent
csharp_prefer_simple_default_expression = true:suggestion

# Expression-bodied members
Expand Down Expand Up @@ -366,7 +400,7 @@ dotnet_diagnostic.SA1501.severity = error
dotnet_diagnostic.SA1502.severity = error
dotnet_diagnostic.SA1503.severity = error
dotnet_diagnostic.SA1504.severity = error
dotnet_diagnostic.SA1505.severity = error
dotnet_diagnostic.SA1505.severity = none
dotnet_diagnostic.SA1506.severity = error
dotnet_diagnostic.SA1507.severity = error
dotnet_diagnostic.SA1508.severity = error
Expand All @@ -375,7 +409,7 @@ dotnet_diagnostic.SA1510.severity = error
dotnet_diagnostic.SA1511.severity = error
dotnet_diagnostic.SA1512.severity = error
dotnet_diagnostic.SA1513.severity = error
dotnet_diagnostic.SA1514.severity = error
dotnet_diagnostic.SA1514.severity = none
dotnet_diagnostic.SA1515.severity = error
dotnet_diagnostic.SA1516.severity = error
dotnet_diagnostic.SA1517.severity = error
Expand Down Expand Up @@ -425,8 +459,45 @@ dotnet_diagnostic.SA1651.severity = error
dotnet_diagnostic.SX1101.severity = error
dotnet_diagnostic.SX1309.severity = error
dotnet_diagnostic.SX1623.severity = none

dotnet_diagnostic.AD0001.severity = none
dotnet_diagnostic.RCS1102.severity=error
dotnet_diagnostic.RCS1166.severity=error
dotnet_diagnostic.RCS1078i.severity=error
dotnet_diagnostic.RCS1248.severity=error
dotnet_diagnostic.RCS1080.severity=error
dotnet_diagnostic.RCS1077.severity=error
dotnet_diagnostic.CA1825.severity=error
dotnet_diagnostic.CA1812.severity=error
dotnet_diagnostic.CA1805.severity=error
dotnet_diagnostic.RCS1197.severity=error
dotnet_diagnostic.RCS1198.severity=error
dotnet_diagnostic.RCS1231.severity=error
dotnet_diagnostic.RCS1235.severity=error
dotnet_diagnostic.RCS1242.severity=error
dotnet_diagnostic.CA2016.severity=warning
dotnet_diagnostic.CA2014.severity=error
dotnet_diagnostic.RCS1010.severity=error
dotnet_diagnostic.RCS1006.severity=error
dotnet_diagnostic.RCS1005.severity=error
dotnet_diagnostic.RCS1020.severity=error
dotnet_diagnostic.RCS1049.severity=warning
dotnet_diagnostic.RCS1058.severity=warning
dotnet_diagnostic.RCS1068.severity=warning
dotnet_diagnostic.RCS1073.severity=warning
dotnet_diagnostic.RCS1084.severity=error
dotnet_diagnostic.RCS1085.severity=error
dotnet_diagnostic.RCS1105.severity=error
dotnet_diagnostic.RCS1112.severity=error
dotnet_diagnostic.RCS1128.severity=error
dotnet_diagnostic.RCS1143.severity=error
dotnet_diagnostic.RCS1171.severity=error
dotnet_diagnostic.RCS1173.severity=error
dotnet_diagnostic.RCS1176.severity=error
dotnet_diagnostic.RCS1177.severity=error
dotnet_diagnostic.RCS1179.severity=error
dotnet_diagnostic.RCS1180.severity=warning
dotnet_diagnostic.RCS1190.severity=error
dotnet_diagnostic.RCS1195.severity=error
dotnet_diagnostic.RCS1214.severity=error

# C++ Files
[*.{cpp,h,in}]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Copyright (c) 2019-2021 ReactiveUI Association Incorporated. All rights reserved.
// ReactiveUI Association Incorporated licenses this file to you under the MIT license.
// See the LICENSE file in the project root for full license information.

using System.Runtime.CompilerServices;
using VerifyTests;

namespace ReactiveMarbles.Locator.Register.SourceGenerator.Tests;

/// <summary>
/// Initialize for the module.
/// </summary>
public static class ModuleInitializer
{
/// <summary>
/// Initializes the source generators.
/// </summary>
[ModuleInitializer]
public static void Init() => VerifySourceGenerators.Enable();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
<LangVersion>preview</LangVersion>
<NoWarn>$(NoWarn);SA1600;CS1591</NoWarn>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="3.1.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Verify.SourceGenerators" Version="1.2.0" />
<PackageReference Include="Verify.Xunit" Version="13.0.3" />
<PackageReference Include="ReactiveMarbles.SourceGenerator.TestNuGetHelper" Version="1.1.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\ReactiveMarbles.Locator.Register.SourceGenerator\ReactiveMarbles.Locator.Register.SourceGenerator.csproj" />
<ProjectReference Include="..\ReactiveMarbles.Locator\ReactiveMarbles.Locator.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
Diagnostics: [
{
Id: SPLATDI005,
Title: Constructors must not have a circular dependency,
Severity: Error,
WarningLevel: 0,
Location: : (26,36)-(26,44),
MessageFormat: Constructor parameters must not have a circular dependency to another registered resource,
Message: Constructor parameters must not have a circular dependency to another registered resource,
Category: Compiler
},
{
Id: SPLATDI005,
Title: Constructors must not have a circular dependency,
Severity: Error,
WarningLevel: 0,
Location: : (18,36)-(18,44),
MessageFormat: Constructor parameters must not have a circular dependency to another registered resource,
Message: Constructor parameters must not have a circular dependency to another registered resource,
Category: Compiler
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
//HintName: Splat.DI.Extensions.SourceGenerated.cs

// <auto-generated />
namespace ReactiveMarbles.Locator
{
/// <summary>
/// Extension methods for the Splat DI source generator.
/// </summary>
[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage]
[global::System.Diagnostics.DebuggerNonUserCode]
[Preserve(AllMembers=true)]
[global::System.Reflection.Obfuscation(Exclude=true)]
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
internal static partial class LocatorRegistrations
{
/// <summary>
/// Registers a class with its concrete class.
/// </summary>
public static void Register<TInterface, TConcrete>()
{
}

/// <summary>
/// Registers a class with its concrete class.
/// </summary>
/// <param name="contract">Optional contract.</param>
public static void Register<TInterface, TConcrete>(string contract)
{
}

/// <summary>
/// Registers a class with its concrete class.
/// </summary>
public static void RegisterLazySingleton<TInterface, TConcrete>()
{
}

/// <summary>
/// Registers a class with its concrete class.
/// </summary>
/// <param name="mode">The threading mode.</param>
public static void RegisterLazySingleton<TInterface, TConcrete>(System.Threading.LazyThreadSafetyMode mode)
{
}

/// <summary>
/// Registers a class with its concrete class.
/// </summary>
/// <param name="contract">Optional contract.</param>
public static void RegisterLazySingleton<TInterface, TConcrete>(string contract)
{
}

/// <summary>
/// Registers a class with its concrete class.
/// </summary>
/// <param name="contract">Optional contract.</param>
/// <param name="mode">The threading mode.</param>
public static void RegisterLazySingleton<TInterface, TConcrete>(string contract, System.Threading.LazyThreadSafetyMode mode)
{
}

/// <summary>
/// Registers a class with its concrete class.
/// </summary>
public static void Register<T>()
{
}


/// <summary>
/// Registers a class with its concrete class.
/// </summary>
/// <param name="contract">Optional contract.</param>
public static void Register<T>(string contract)
{
}

/// <summary>
/// Registers a lazy class with its concrete class.
/// </summary>
public static void RegisterLazySingleton<T>()
{
}


/// <summary>
/// Registers a lazy class with its concrete class.
/// </summary>
/// <param name="contract">Optional contract.</param>
public static void RegisterLazySingleton<T>(string contract)
{
}

/// <summary>
/// Registers the registrations.
/// </summary>
public static void SetupIOC()
{
SetupIOCInternal(global::ReactiveMarbles.Locator.ServiceLocator.Current());
}

/// <summary>
/// Registers the registrations.
/// </summary>
/// <param name="locator">The locator to register.</param>
public static void SetupIOC(global::ReactiveMarbles.Locator.IServiceLocator locator)
{
SetupIOCInternal(locator);
}

static partial void SetupIOCInternal(global::ReactiveMarbles.Locator.IServiceLocator resolver);
}

/// <summary>
/// Makes the property get added by the DI engine.
/// </summary>
[System.AttributeUsage(System.AttributeTargets.Property)]
internal class DependencyInjectionPropertyAttribute : System.Attribute
{
/// <summary>
/// Initializes a new instance of the <see cref="DependencyInjectionPropertyAttribute"/> class.
/// </summary>
public DependencyInjectionPropertyAttribute()
{
}
}

/// <summary>
/// Makes this the constructor used by the DI engine.
/// </summary>
[System.AttributeUsage(System.AttributeTargets.Constructor)]
internal class DependencyInjectionConstructorAttribute : System.Attribute
{
/// <summary>
/// Initializes a new instance of the <see cref="DependencyInjectionConstructorAttribute"/> class.
/// </summary>
public DependencyInjectionConstructorAttribute()
{
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//HintName: Splat.DI.Extensions.Registrations.SourceGenerated.cs

// <auto-generated />
namespace ReactiveMarbles.Locator
{
internal static partial class LocatorRegistrations
{
static partial void SetupIOCInternal( ReactiveMarbles.Locator.IServiceLocator resolver)
{
}
}
}
Loading