From 4741277be50dbb079227830b9febb789186f4d86 Mon Sep 17 00:00:00 2001 From: Ivan Maximov Date: Mon, 17 Apr 2023 01:12:46 +0300 Subject: [PATCH 1/2] Introduce PolySharp, bump Shouldly --- .../GraphQLParser.ApiTests.csproj | 2 +- .../GraphQLParser.Tests.csproj | 2 +- .../Annotations/DoesNotReturnAttribute.cs | 12 ---------- .../Annotations/IsExternalInit.cs | 16 ------------- .../Annotations/NotNullWhenAttribute.cs | 23 ------------------- src/GraphQLParser/GraphQLParser.csproj | 4 ++++ 6 files changed, 6 insertions(+), 53 deletions(-) delete mode 100644 src/GraphQLParser/Annotations/DoesNotReturnAttribute.cs delete mode 100644 src/GraphQLParser/Annotations/IsExternalInit.cs delete mode 100644 src/GraphQLParser/Annotations/NotNullWhenAttribute.cs diff --git a/src/GraphQLParser.ApiTests/GraphQLParser.ApiTests.csproj b/src/GraphQLParser.ApiTests/GraphQLParser.ApiTests.csproj index 75473089..86864a93 100644 --- a/src/GraphQLParser.ApiTests/GraphQLParser.ApiTests.csproj +++ b/src/GraphQLParser.ApiTests/GraphQLParser.ApiTests.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/GraphQLParser.Tests/GraphQLParser.Tests.csproj b/src/GraphQLParser.Tests/GraphQLParser.Tests.csproj index a5239c52..a6e94a41 100644 --- a/src/GraphQLParser.Tests/GraphQLParser.Tests.csproj +++ b/src/GraphQLParser.Tests/GraphQLParser.Tests.csproj @@ -25,7 +25,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/src/GraphQLParser/Annotations/DoesNotReturnAttribute.cs b/src/GraphQLParser/Annotations/DoesNotReturnAttribute.cs deleted file mode 100644 index abebe684..00000000 --- a/src/GraphQLParser/Annotations/DoesNotReturnAttribute.cs +++ /dev/null @@ -1,12 +0,0 @@ -#if NETSTANDARD2_0 - -// https://github.com/dotnet/runtime/blob/main/src/libraries/System.Private.CoreLib/src/System/Diagnostics/CodeAnalysis/NullableAttributes.cs#L107 -namespace System.Diagnostics.CodeAnalysis; - -/// Applied to a method that will never return under any circumstance. -[AttributeUsage(AttributeTargets.Method, Inherited = false)] -internal sealed class DoesNotReturnAttribute : Attribute -{ -} - -#endif diff --git a/src/GraphQLParser/Annotations/IsExternalInit.cs b/src/GraphQLParser/Annotations/IsExternalInit.cs deleted file mode 100644 index 332aab13..00000000 --- a/src/GraphQLParser/Annotations/IsExternalInit.cs +++ /dev/null @@ -1,16 +0,0 @@ -#if !NET5_0_OR_GREATER - -using System.ComponentModel; - -namespace System.Runtime.CompilerServices; - -/// -/// Reserved to be used by the compiler for tracking metadata. -/// This class should not be used by developers in source code. -/// -[EditorBrowsable(EditorBrowsableState.Never)] -internal static class IsExternalInit -{ -} - -#endif diff --git a/src/GraphQLParser/Annotations/NotNullWhenAttribute.cs b/src/GraphQLParser/Annotations/NotNullWhenAttribute.cs deleted file mode 100644 index 5c2b3568..00000000 --- a/src/GraphQLParser/Annotations/NotNullWhenAttribute.cs +++ /dev/null @@ -1,23 +0,0 @@ -#if NETSTANDARD2_0 - -// https://github.com/dotnet/runtime/blob/main/src/libraries/System.Private.CoreLib/src/System/Diagnostics/CodeAnalysis/NullableAttributes.cs#L69 -namespace System.Diagnostics.CodeAnalysis; - -/// Specifies that when a method returns , the parameter will not be null even if the corresponding type allows it. -[AttributeUsage(AttributeTargets.Parameter, Inherited = false)] -internal sealed class NotNullWhenAttribute : Attribute -{ - /// Initializes the attribute with the specified return value condition. - /// - /// The return value condition. If the method returns this value, the associated parameter will not be null. - /// - public NotNullWhenAttribute(bool returnValue) - { - ReturnValue = returnValue; - } - - /// Gets the return value condition. - public bool ReturnValue { get; } -} - -#endif diff --git a/src/GraphQLParser/GraphQLParser.csproj b/src/GraphQLParser/GraphQLParser.csproj index 0782e98c..a4d48ff2 100644 --- a/src/GraphQLParser/GraphQLParser.csproj +++ b/src/GraphQLParser/GraphQLParser.csproj @@ -13,6 +13,10 @@ + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + From e115fbbce53a212d2a947cc2a3345d29afc77296 Mon Sep 17 00:00:00 2001 From: Ivan Maximov Date: Mon, 17 Apr 2023 01:50:44 +0300 Subject: [PATCH 2/2] revert --- src/GraphQLParser.ApiTests/GraphQLParser.ApiTests.csproj | 2 +- src/GraphQLParser.Tests/GraphQLParser.Tests.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/GraphQLParser.ApiTests/GraphQLParser.ApiTests.csproj b/src/GraphQLParser.ApiTests/GraphQLParser.ApiTests.csproj index 86864a93..75473089 100644 --- a/src/GraphQLParser.ApiTests/GraphQLParser.ApiTests.csproj +++ b/src/GraphQLParser.ApiTests/GraphQLParser.ApiTests.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/GraphQLParser.Tests/GraphQLParser.Tests.csproj b/src/GraphQLParser.Tests/GraphQLParser.Tests.csproj index a6e94a41..a5239c52 100644 --- a/src/GraphQLParser.Tests/GraphQLParser.Tests.csproj +++ b/src/GraphQLParser.Tests/GraphQLParser.Tests.csproj @@ -25,7 +25,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - +