From 6309adfde61818efd365cd62c7b7634d383fe26c Mon Sep 17 00:00:00 2001 From: Adam Hathcock Date: Sat, 18 May 2024 09:33:36 +0100 Subject: [PATCH] warnings as errors --- .../AccessorsGenerationTests.cs | 16 ++++++++-------- .../MethodGenerationTests.cs | 2 +- .../Speckle.InterfaceGenerator.Tests.csproj | 2 ++ .../Speckle.InterfaceGenerator.csproj | 1 + 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/Speckle.InterfaceGenerator.Tests/AccessorsGenerationTests.cs b/Speckle.InterfaceGenerator.Tests/AccessorsGenerationTests.cs index 3baf4c7..ebdeb51 100644 --- a/Speckle.InterfaceGenerator.Tests/AccessorsGenerationTests.cs +++ b/Speckle.InterfaceGenerator.Tests/AccessorsGenerationTests.cs @@ -166,21 +166,21 @@ internal class AccessorsTestsService : IAccessorsTestsService set { } } - public string PublicProperty { get; set; } + public string PublicProperty { get; set; } = string.Empty; - public string InitOnlyProperty { get; init; } + public string InitOnlyProperty { get; init; } = string.Empty; - public string PropertyWithPrivateSetter { get; private set; } + public string PropertyWithPrivateSetter { get; private set; } = string.Empty; - public string PropertyWithPrivateGetter { private get; set; } + public string PropertyWithPrivateGetter { private get; set; } = string.Empty; - public string PropertyWithProtectedSetter { get; protected set; } + public string PropertyWithProtectedSetter { get; protected set; } = string.Empty; - public string PropertyWithProtectedGetter { protected get; set; } + public string PropertyWithProtectedGetter { protected get; set; } = string.Empty; [AutoInterfaceIgnore] - public string IgnoredProperty { get; set; } + public string IgnoredProperty { get; set; } = string.Empty; - public static string StaticProperty { get; set; } + public static string StaticProperty { get; set; } = string.Empty; } // ReSharper enable UnusedMember.Local, ValueParameterNotUsed diff --git a/Speckle.InterfaceGenerator.Tests/MethodGenerationTests.cs b/Speckle.InterfaceGenerator.Tests/MethodGenerationTests.cs index 36ea1e7..263766b 100644 --- a/Speckle.InterfaceGenerator.Tests/MethodGenerationTests.cs +++ b/Speckle.InterfaceGenerator.Tests/MethodGenerationTests.cs @@ -331,7 +331,7 @@ internal class MethodsTestService : IMethodsTestService public void VoidMethodWithOutParam(out string a) { - a = default; + a = string.Empty; } public void VoidMethodWithRefParam(ref string a) { } diff --git a/Speckle.InterfaceGenerator.Tests/Speckle.InterfaceGenerator.Tests.csproj b/Speckle.InterfaceGenerator.Tests/Speckle.InterfaceGenerator.Tests.csproj index d3121c9..1115338 100644 --- a/Speckle.InterfaceGenerator.Tests/Speckle.InterfaceGenerator.Tests.csproj +++ b/Speckle.InterfaceGenerator.Tests/Speckle.InterfaceGenerator.Tests.csproj @@ -4,6 +4,8 @@ net8.0 false Speckle.InterfaceGenerator.Tests + enable + true diff --git a/Speckle.InterfaceGenerator/Speckle.InterfaceGenerator.csproj b/Speckle.InterfaceGenerator/Speckle.InterfaceGenerator.csproj index e6f5c93..af9c35d 100644 --- a/Speckle.InterfaceGenerator/Speckle.InterfaceGenerator.csproj +++ b/Speckle.InterfaceGenerator/Speckle.InterfaceGenerator.csproj @@ -11,6 +11,7 @@ true Speckle.InterfaceGenerator true + true