From 87fd744777a3d535d47a05e1e7465ed48df21ae1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20R=C3=B6mer?= <30902964+manuelroemer@users.noreply.github.com> Date: Tue, 24 Dec 2019 13:04:48 +0100 Subject: [PATCH 1/7] Add conditional support for ExcludeFromCodeCoverageAttribute. In NullableAttributes, ignore all warnings via #pragma warning disable. Start of supporting packages.config. --- .editorconfig | 13 + .../Nullable.ExcludeFromCodeCoverage.csproj} | 6 +- .../NullableAttributes.cs | 263 ++++++++++++++++++ .../Nullable.NoExcludeFromCodeCoverage.csproj | 11 + .../NullableAttributes.cs | 41 +-- src/Nullable.nuspec | 34 ++- src/Nullable.sln | 42 ++- 7 files changed, 367 insertions(+), 43 deletions(-) create mode 100644 .editorconfig rename src/{Nullable/Nullable.csproj => Nullable.ExcludeFromCodeCoverage/Nullable.ExcludeFromCodeCoverage.csproj} (62%) create mode 100644 src/Nullable.ExcludeFromCodeCoverage/NullableAttributes.cs create mode 100644 src/Nullable.NoExcludeFromCodeCoverage/Nullable.NoExcludeFromCodeCoverage.csproj rename src/{Nullable => Nullable.NoExcludeFromCodeCoverage}/NullableAttributes.cs (86%) diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..a5ef000 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,13 @@ +root = true + +[*] +indent_style = space +indent_size = 4 +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +end_of_line = lf +max_line_length = 120 + +[*.md] +indent_size=2 diff --git a/src/Nullable/Nullable.csproj b/src/Nullable.ExcludeFromCodeCoverage/Nullable.ExcludeFromCodeCoverage.csproj similarity index 62% rename from src/Nullable/Nullable.csproj rename to src/Nullable.ExcludeFromCodeCoverage/Nullable.ExcludeFromCodeCoverage.csproj index 34d9906..aa8364b 100644 --- a/src/Nullable/Nullable.csproj +++ b/src/Nullable.ExcludeFromCodeCoverage/Nullable.ExcludeFromCodeCoverage.csproj @@ -1,4 +1,4 @@ - + netstandard2.0 @@ -8,8 +8,4 @@ true - - - - diff --git a/src/Nullable.ExcludeFromCodeCoverage/NullableAttributes.cs b/src/Nullable.ExcludeFromCodeCoverage/NullableAttributes.cs new file mode 100644 index 0000000..5cd4247 --- /dev/null +++ b/src/Nullable.ExcludeFromCodeCoverage/NullableAttributes.cs @@ -0,0 +1,263 @@ +// +// This code file has automatically been added by the "Nullable" NuGet package (https://www.nuget.org/packages/Nullable). +// Please see https://github.com/manuelroemer/Nullable for more information. +// + +#region License +// MIT License +// +// Copyright (c) 2019 Manuel Römer +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +#endregion + +#if !NULLABLE_ATTRIBUTES_DISABLE +#nullable enable +#pragma warning disable + +namespace System.Diagnostics.CodeAnalysis +{ + using global::System; + using global::System.CodeDom.Compiler; + + /// + /// Specifies that is allowed as an input even if the + /// corresponding type disallows it. + /// + [AttributeUsage( + AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property, + Inherited = false + )] +#if !NULLABLE_ATTRIBUTES_INCLUDE_IN_CODE_COVERAGE + [ExcludeFromCodeCoverage, DebuggerNonUserCode, GeneratedCode("https://www.nuget.org/packages/Nullable", "1.2.0")] +#endif + internal sealed class AllowNullAttribute : Attribute + { + /// + /// Initializes a new instance of the class. + /// + public AllowNullAttribute() { } + } + + /// + /// Specifies that is disallowed as an input even if the + /// corresponding type allows it. + /// + [AttributeUsage( + AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property, + Inherited = false + )] +#if !NULLABLE_ATTRIBUTES_INCLUDE_IN_CODE_COVERAGE + [ExcludeFromCodeCoverage, DebuggerNonUserCode, GeneratedCode("https://www.nuget.org/packages/Nullable", "1.2.0")] +#endif + internal sealed class DisallowNullAttribute : Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DisallowNullAttribute() { } + } + + /// + /// Specifies that a method that will never return under any circumstance. + /// + [AttributeUsage(AttributeTargets.Method, Inherited = false)] +#if !NULLABLE_ATTRIBUTES_INCLUDE_IN_CODE_COVERAGE + [ExcludeFromCodeCoverage, DebuggerNonUserCode, GeneratedCode("https://www.nuget.org/packages/Nullable", "1.2.0")] +#endif + internal sealed class DoesNotReturnAttribute : Attribute + { + /// + /// Initializes a new instance of the class. + /// + public DoesNotReturnAttribute() { } + } + + /// + /// Specifies that the method will not return if the associated + /// parameter is passed the specified value. + /// + [AttributeUsage(AttributeTargets.Parameter, Inherited = false)] +#if !NULLABLE_ATTRIBUTES_INCLUDE_IN_CODE_COVERAGE + [ExcludeFromCodeCoverage, DebuggerNonUserCode, GeneratedCode("https://www.nuget.org/packages/Nullable", "1.2.0")] +#endif + internal sealed class DoesNotReturnIfAttribute : Attribute + { + /// + /// Gets the condition parameter value. + /// Code after the method is considered unreachable by diagnostics if the argument + /// to the associated parameter matches this value. + /// + public bool ParameterValue { get; } + + /// + /// Initializes a new instance of the + /// class with the specified parameter value. + /// + /// + /// The condition parameter value. + /// Code after the method is considered unreachable by diagnostics if the argument + /// to the associated parameter matches this value. + /// + public DoesNotReturnIfAttribute(bool parameterValue) + { + ParameterValue = parameterValue; + } + } + + /// + /// Specifies that an output may be even if the + /// corresponding type disallows it. + /// + [AttributeUsage( + AttributeTargets.Field | AttributeTargets.Parameter | + AttributeTargets.Property | AttributeTargets.ReturnValue, + Inherited = false + )] +#if !NULLABLE_ATTRIBUTES_INCLUDE_IN_CODE_COVERAGE + [ExcludeFromCodeCoverage, DebuggerNonUserCode, GeneratedCode("https://www.nuget.org/packages/Nullable", "1.2.0")] +#endif + internal sealed class MaybeNullAttribute : Attribute + { + /// + /// Initializes a new instance of the class. + /// + public MaybeNullAttribute() { } + } + + /// + /// Specifies that when a method returns , + /// the parameter may be even if the corresponding type disallows it. + /// + [AttributeUsage(AttributeTargets.Parameter, Inherited = false)] +#if !NULLABLE_ATTRIBUTES_INCLUDE_IN_CODE_COVERAGE + [ExcludeFromCodeCoverage, DebuggerNonUserCode, GeneratedCode("https://www.nuget.org/packages/Nullable", "1.2.0")] +#endif + internal sealed class MaybeNullWhenAttribute : Attribute + { + /// + /// Gets the return value condition. + /// If the method returns this value, the associated parameter may be . + /// + public bool ReturnValue { get; } + + /// + /// Initializes the attribute with the specified return value condition. + /// + /// + /// The return value condition. + /// If the method returns this value, the associated parameter may be . + /// + public MaybeNullWhenAttribute(bool returnValue) + { + ReturnValue = returnValue; + } + } + + /// + /// Specifies that an output is not even if the + /// corresponding type allows it. + /// + [AttributeUsage( + AttributeTargets.Field | AttributeTargets.Parameter | + AttributeTargets.Property | AttributeTargets.ReturnValue, + Inherited = false + )] +#if !NULLABLE_ATTRIBUTES_INCLUDE_IN_CODE_COVERAGE + [ExcludeFromCodeCoverage, DebuggerNonUserCode, GeneratedCode("https://www.nuget.org/packages/Nullable", "1.2.0")] +#endif + internal sealed class NotNullAttribute : Attribute + { + /// + /// Initializes a new instance of the class. + /// + public NotNullAttribute() { } + } + + /// + /// Specifies that the output will be non- if the + /// named parameter is non-. + /// + [AttributeUsage( + AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue, + AllowMultiple = true, + Inherited = false + )] +#if !NULLABLE_ATTRIBUTES_INCLUDE_IN_CODE_COVERAGE + [ExcludeFromCodeCoverage, DebuggerNonUserCode, GeneratedCode("https://www.nuget.org/packages/Nullable", "1.2.0")] +#endif + internal sealed class NotNullIfNotNullAttribute : Attribute + { + /// + /// Gets the associated parameter name. + /// The output will be non- if the argument to the + /// parameter specified is non-. + /// + public string ParameterName { get; } + + /// + /// Initializes the attribute with the associated parameter name. + /// + /// + /// The associated parameter name. + /// The output will be non- if the argument to the + /// parameter specified is non-. + /// + public NotNullIfNotNullAttribute(string parameterName) + { + // .NET Core 3.0 doesn't throw an ArgumentNullException, even though this is + // tagged as non-null. + // Follow this behavior here. + ParameterName = parameterName; + } + } + + /// + /// Specifies that when a method returns , + /// the parameter will not be even if the corresponding type allows it. + /// + [AttributeUsage(AttributeTargets.Parameter, Inherited = false)] +#if !NULLABLE_ATTRIBUTES_INCLUDE_IN_CODE_COVERAGE + [ExcludeFromCodeCoverage, DebuggerNonUserCode, GeneratedCode("https://www.nuget.org/packages/Nullable", "1.2.0")] +#endif + internal sealed class NotNullWhenAttribute : Attribute + { + /// + /// Gets the return value condition. + /// If the method returns this value, the associated parameter will not be . + /// + public bool ReturnValue { get; } + + /// + /// 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 . + /// + public NotNullWhenAttribute(bool returnValue) + { + ReturnValue = returnValue; + } + } +} + +#pragma warning enable +#nullable restore +#endif // NULLABLE_ATTRIBUTES_DISABLE diff --git a/src/Nullable.NoExcludeFromCodeCoverage/Nullable.NoExcludeFromCodeCoverage.csproj b/src/Nullable.NoExcludeFromCodeCoverage/Nullable.NoExcludeFromCodeCoverage.csproj new file mode 100644 index 0000000..65d65e2 --- /dev/null +++ b/src/Nullable.NoExcludeFromCodeCoverage/Nullable.NoExcludeFromCodeCoverage.csproj @@ -0,0 +1,11 @@ + + + + netstandard1.0 + 8.0 + enable + System.Diagnostics.CodeAnalysis + true + + + diff --git a/src/Nullable/NullableAttributes.cs b/src/Nullable.NoExcludeFromCodeCoverage/NullableAttributes.cs similarity index 86% rename from src/Nullable/NullableAttributes.cs rename to src/Nullable.NoExcludeFromCodeCoverage/NullableAttributes.cs index 6090e12..faf76bc 100644 --- a/src/Nullable/NullableAttributes.cs +++ b/src/Nullable.NoExcludeFromCodeCoverage/NullableAttributes.cs @@ -1,4 +1,4 @@ -// +// // This code file has automatically been added by the "Nullable" NuGet package (https://www.nuget.org/packages/Nullable). // Please see https://github.com/manuelroemer/Nullable for more information. // @@ -29,10 +29,12 @@ #if !NULLABLE_ATTRIBUTES_DISABLE #nullable enable +#pragma warning disable namespace System.Diagnostics.CodeAnalysis { using global::System; + using global::System.CodeDom.Compiler; /// /// Specifies that is allowed as an input even if the @@ -42,8 +44,8 @@ namespace System.Diagnostics.CodeAnalysis AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property, Inherited = false )] -#if NULLABLE_ATTRIBUTES_EXCLUDE_FROM_CODE_COVERAGE - [ExcludeFromCodeCoverage] +#if !NULLABLE_ATTRIBUTES_INCLUDE_IN_CODE_COVERAGE + [DebuggerNonUserCode, GeneratedCode("https://www.nuget.org/packages/Nullable", "1.2.0")] #endif internal sealed class AllowNullAttribute : Attribute { @@ -61,8 +63,8 @@ public AllowNullAttribute() { } AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property, Inherited = false )] -#if NULLABLE_ATTRIBUTES_EXCLUDE_FROM_CODE_COVERAGE - [ExcludeFromCodeCoverage] +#if !NULLABLE_ATTRIBUTES_INCLUDE_IN_CODE_COVERAGE + [DebuggerNonUserCode, GeneratedCode("https://www.nuget.org/packages/Nullable", "1.2.0")] #endif internal sealed class DisallowNullAttribute : Attribute { @@ -76,8 +78,8 @@ public DisallowNullAttribute() { } /// Specifies that a method that will never return under any circumstance. /// [AttributeUsage(AttributeTargets.Method, Inherited = false)] -#if NULLABLE_ATTRIBUTES_EXCLUDE_FROM_CODE_COVERAGE - [ExcludeFromCodeCoverage] +#if !NULLABLE_ATTRIBUTES_INCLUDE_IN_CODE_COVERAGE + [DebuggerNonUserCode, GeneratedCode("https://www.nuget.org/packages/Nullable", "1.2.0")] #endif internal sealed class DoesNotReturnAttribute : Attribute { @@ -92,8 +94,8 @@ public DoesNotReturnAttribute() { } /// parameter is passed the specified value. /// [AttributeUsage(AttributeTargets.Parameter, Inherited = false)] -#if NULLABLE_ATTRIBUTES_EXCLUDE_FROM_CODE_COVERAGE - [ExcludeFromCodeCoverage] +#if !NULLABLE_ATTRIBUTES_INCLUDE_IN_CODE_COVERAGE + [DebuggerNonUserCode, GeneratedCode("https://www.nuget.org/packages/Nullable", "1.2.0")] #endif internal sealed class DoesNotReturnIfAttribute : Attribute { @@ -128,8 +130,8 @@ public DoesNotReturnIfAttribute(bool parameterValue) AttributeTargets.Property | AttributeTargets.ReturnValue, Inherited = false )] -#if NULLABLE_ATTRIBUTES_EXCLUDE_FROM_CODE_COVERAGE - [ExcludeFromCodeCoverage] +#if !NULLABLE_ATTRIBUTES_INCLUDE_IN_CODE_COVERAGE + [DebuggerNonUserCode, GeneratedCode("https://www.nuget.org/packages/Nullable", "1.2.0")] #endif internal sealed class MaybeNullAttribute : Attribute { @@ -144,8 +146,8 @@ public MaybeNullAttribute() { } /// the parameter may be even if the corresponding type disallows it. /// [AttributeUsage(AttributeTargets.Parameter, Inherited = false)] -#if NULLABLE_ATTRIBUTES_EXCLUDE_FROM_CODE_COVERAGE - [ExcludeFromCodeCoverage] +#if !NULLABLE_ATTRIBUTES_INCLUDE_IN_CODE_COVERAGE + [DebuggerNonUserCode, GeneratedCode("https://www.nuget.org/packages/Nullable", "1.2.0")] #endif internal sealed class MaybeNullWhenAttribute : Attribute { @@ -177,8 +179,8 @@ public MaybeNullWhenAttribute(bool returnValue) AttributeTargets.Property | AttributeTargets.ReturnValue, Inherited = false )] -#if NULLABLE_ATTRIBUTES_EXCLUDE_FROM_CODE_COVERAGE - [ExcludeFromCodeCoverage] +#if !NULLABLE_ATTRIBUTES_INCLUDE_IN_CODE_COVERAGE + [DebuggerNonUserCode, GeneratedCode("https://www.nuget.org/packages/Nullable", "1.2.0")] #endif internal sealed class NotNullAttribute : Attribute { @@ -197,8 +199,8 @@ public NotNullAttribute() { } AllowMultiple = true, Inherited = false )] -#if NULLABLE_ATTRIBUTES_EXCLUDE_FROM_CODE_COVERAGE - [ExcludeFromCodeCoverage] +#if !NULLABLE_ATTRIBUTES_INCLUDE_IN_CODE_COVERAGE + [DebuggerNonUserCode, GeneratedCode("https://www.nuget.org/packages/Nullable", "1.2.0")] #endif internal sealed class NotNullIfNotNullAttribute : Attribute { @@ -231,8 +233,8 @@ public NotNullIfNotNullAttribute(string parameterName) /// the parameter will not be even if the corresponding type allows it. /// [AttributeUsage(AttributeTargets.Parameter, Inherited = false)] -#if NULLABLE_ATTRIBUTES_EXCLUDE_FROM_CODE_COVERAGE - [ExcludeFromCodeCoverage] +#if !NULLABLE_ATTRIBUTES_INCLUDE_IN_CODE_COVERAGE + [DebuggerNonUserCode, GeneratedCode("https://www.nuget.org/packages/Nullable", "1.2.0")] #endif internal sealed class NotNullWhenAttribute : Attribute { @@ -256,5 +258,6 @@ public NotNullWhenAttribute(bool returnValue) } } +#pragma warning enable #nullable restore #endif // NULLABLE_ATTRIBUTES_DISABLE diff --git a/src/Nullable.nuspec b/src/Nullable.nuspec index d57efcd..bde6295 100644 --- a/src/Nullable.nuspec +++ b/src/Nullable.nuspec @@ -2,7 +2,7 @@ Nullable - 1.1.1 + 1.2.0 true Manuel Römer MIT @@ -26,12 +26,36 @@ Please see https://github.com/manuelroemer/Nullable for additional information o - - - + + The ExcludeFromCodeCoverageAttribute is available in: + * .NET Standard >= 2.0 + * .NET Framework >= 4.0 + Depending on the target framework, pick a different file which makes use/doesn't make use of that attribute. + + Include the file both as 'contentFiles' (for PackageReferences) and as 'content' (for packages.config). + --> + + + + + + + + + + + + + + + + + + + diff --git a/src/Nullable.sln b/src/Nullable.sln index 12513e2..3770cc5 100644 --- a/src/Nullable.sln +++ b/src/Nullable.sln @@ -3,14 +3,16 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.29318.209 MinimumVisualStudioVersion = 15.0.26124.0 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Nullable", "Nullable\Nullable.csproj", "{CF706627-67DC-4B26-9F0B-0095A8DF4D26}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".Config", ".Config", "{CA94F8B9-B786-4737-B21A-FD4D2AE5D9E0}" ProjectSection(SolutionItems) = preProject ..\build.ps1 = ..\build.ps1 Nullable.nuspec = Nullable.nuspec EndProjectSection EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Nullable.ExcludeFromCodeCoverage", "Nullable.ExcludeFromCodeCoverage\Nullable.ExcludeFromCodeCoverage.csproj", "{AFA70C9B-6FA2-4CF7-8DB2-744E8C10D1C8}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Nullable.NoExcludeFromCodeCoverage", "Nullable.NoExcludeFromCodeCoverage\Nullable.NoExcludeFromCodeCoverage.csproj", "{F9CEC7D5-3C05-4EA4-B074-961E7BF57FB2}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -21,18 +23,30 @@ Global Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {CF706627-67DC-4B26-9F0B-0095A8DF4D26}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CF706627-67DC-4B26-9F0B-0095A8DF4D26}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CF706627-67DC-4B26-9F0B-0095A8DF4D26}.Debug|x64.ActiveCfg = Debug|Any CPU - {CF706627-67DC-4B26-9F0B-0095A8DF4D26}.Debug|x64.Build.0 = Debug|Any CPU - {CF706627-67DC-4B26-9F0B-0095A8DF4D26}.Debug|x86.ActiveCfg = Debug|Any CPU - {CF706627-67DC-4B26-9F0B-0095A8DF4D26}.Debug|x86.Build.0 = Debug|Any CPU - {CF706627-67DC-4B26-9F0B-0095A8DF4D26}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CF706627-67DC-4B26-9F0B-0095A8DF4D26}.Release|Any CPU.Build.0 = Release|Any CPU - {CF706627-67DC-4B26-9F0B-0095A8DF4D26}.Release|x64.ActiveCfg = Release|Any CPU - {CF706627-67DC-4B26-9F0B-0095A8DF4D26}.Release|x64.Build.0 = Release|Any CPU - {CF706627-67DC-4B26-9F0B-0095A8DF4D26}.Release|x86.ActiveCfg = Release|Any CPU - {CF706627-67DC-4B26-9F0B-0095A8DF4D26}.Release|x86.Build.0 = Release|Any CPU + {AFA70C9B-6FA2-4CF7-8DB2-744E8C10D1C8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AFA70C9B-6FA2-4CF7-8DB2-744E8C10D1C8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AFA70C9B-6FA2-4CF7-8DB2-744E8C10D1C8}.Debug|x64.ActiveCfg = Debug|Any CPU + {AFA70C9B-6FA2-4CF7-8DB2-744E8C10D1C8}.Debug|x64.Build.0 = Debug|Any CPU + {AFA70C9B-6FA2-4CF7-8DB2-744E8C10D1C8}.Debug|x86.ActiveCfg = Debug|Any CPU + {AFA70C9B-6FA2-4CF7-8DB2-744E8C10D1C8}.Debug|x86.Build.0 = Debug|Any CPU + {AFA70C9B-6FA2-4CF7-8DB2-744E8C10D1C8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AFA70C9B-6FA2-4CF7-8DB2-744E8C10D1C8}.Release|Any CPU.Build.0 = Release|Any CPU + {AFA70C9B-6FA2-4CF7-8DB2-744E8C10D1C8}.Release|x64.ActiveCfg = Release|Any CPU + {AFA70C9B-6FA2-4CF7-8DB2-744E8C10D1C8}.Release|x64.Build.0 = Release|Any CPU + {AFA70C9B-6FA2-4CF7-8DB2-744E8C10D1C8}.Release|x86.ActiveCfg = Release|Any CPU + {AFA70C9B-6FA2-4CF7-8DB2-744E8C10D1C8}.Release|x86.Build.0 = Release|Any CPU + {F9CEC7D5-3C05-4EA4-B074-961E7BF57FB2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F9CEC7D5-3C05-4EA4-B074-961E7BF57FB2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F9CEC7D5-3C05-4EA4-B074-961E7BF57FB2}.Debug|x64.ActiveCfg = Debug|Any CPU + {F9CEC7D5-3C05-4EA4-B074-961E7BF57FB2}.Debug|x64.Build.0 = Debug|Any CPU + {F9CEC7D5-3C05-4EA4-B074-961E7BF57FB2}.Debug|x86.ActiveCfg = Debug|Any CPU + {F9CEC7D5-3C05-4EA4-B074-961E7BF57FB2}.Debug|x86.Build.0 = Debug|Any CPU + {F9CEC7D5-3C05-4EA4-B074-961E7BF57FB2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F9CEC7D5-3C05-4EA4-B074-961E7BF57FB2}.Release|Any CPU.Build.0 = Release|Any CPU + {F9CEC7D5-3C05-4EA4-B074-961E7BF57FB2}.Release|x64.ActiveCfg = Release|Any CPU + {F9CEC7D5-3C05-4EA4-B074-961E7BF57FB2}.Release|x64.Build.0 = Release|Any CPU + {F9CEC7D5-3C05-4EA4-B074-961E7BF57FB2}.Release|x86.ActiveCfg = Release|Any CPU + {F9CEC7D5-3C05-4EA4-B074-961E7BF57FB2}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE From 596b5aca1294a3460aa3587d412b412a398118b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20R=C3=B6mer?= <30902964+manuelroemer@users.noreply.github.com> Date: Tue, 24 Dec 2019 13:05:57 +0100 Subject: [PATCH 2/7] Don't place content files in the 'cs' folder. --- src/Nullable.nuspec | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Nullable.nuspec b/src/Nullable.nuspec index bde6295..866adc8 100644 --- a/src/Nullable.nuspec +++ b/src/Nullable.nuspec @@ -46,16 +46,16 @@ Please see https://github.com/manuelroemer/Nullable for additional information o - - + + - - + + - + From 312ef5dd9e1453bab9d21ef450f2ebb8f332fcff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20R=C3=B6mer?= <30902964+manuelroemer@users.noreply.github.com> Date: Tue, 24 Dec 2019 13:35:40 +0100 Subject: [PATCH 3/7] Updated the file header to include information for packages.config users. --- .../NullableAttributes.cs | 9 +++++++++ .../NullableAttributes.cs | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/src/Nullable.ExcludeFromCodeCoverage/NullableAttributes.cs b/src/Nullable.ExcludeFromCodeCoverage/NullableAttributes.cs index 5cd4247..17e4d07 100644 --- a/src/Nullable.ExcludeFromCodeCoverage/NullableAttributes.cs +++ b/src/Nullable.ExcludeFromCodeCoverage/NullableAttributes.cs @@ -1,6 +1,15 @@ // // This code file has automatically been added by the "Nullable" NuGet package (https://www.nuget.org/packages/Nullable). // Please see https://github.com/manuelroemer/Nullable for more information. +// +// IMPORTANT: +// NEVER DELETE THIS FILE if you are using a "packages.config" file to manage your NuGet references. +// Consider migrating to PackageReferences instead: +// https://docs.microsoft.com/en-us/nuget/consume-packages/migrate-packages-config-to-package-reference +// Migrating brings the following benefits: +// * The "Nullable" folder and the "NullableAttributes.cs" files don't appear in your project. +// * The added files are immutable and can therefore not be modified by coincidence. +// * Updating/Uninstalling the package will work flawlessly. // #region License diff --git a/src/Nullable.NoExcludeFromCodeCoverage/NullableAttributes.cs b/src/Nullable.NoExcludeFromCodeCoverage/NullableAttributes.cs index faf76bc..abd723b 100644 --- a/src/Nullable.NoExcludeFromCodeCoverage/NullableAttributes.cs +++ b/src/Nullable.NoExcludeFromCodeCoverage/NullableAttributes.cs @@ -1,6 +1,15 @@ // // This code file has automatically been added by the "Nullable" NuGet package (https://www.nuget.org/packages/Nullable). // Please see https://github.com/manuelroemer/Nullable for more information. +// +// IMPORTANT: +// NEVER DELETE THIS FILE if you are using a "packages.config" file to manage your NuGet references. +// Consider migrating to PackageReferences instead: +// https://docs.microsoft.com/en-us/nuget/consume-packages/migrate-packages-config-to-package-reference +// Migrating brings the following benefits: +// * The "Nullable" folder and the "NullableAttributes.cs" files don't appear in your project. +// * The added files are immutable and can therefore not be modified by coincidence. +// * Updating/Uninstalling the package will work flawlessly. // #region License From 28d61469a5c212619e4596aaaa58dc5d75d7d38e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20R=C3=B6mer?= <30902964+manuelroemer@users.noreply.github.com> Date: Tue, 24 Dec 2019 13:57:23 +0100 Subject: [PATCH 4/7] Remove the GeneratedCodeAttribute. --- .../NullableAttributes.cs | 19 +++++++++---------- .../NullableAttributes.cs | 19 +++++++++---------- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/src/Nullable.ExcludeFromCodeCoverage/NullableAttributes.cs b/src/Nullable.ExcludeFromCodeCoverage/NullableAttributes.cs index 17e4d07..b68c206 100644 --- a/src/Nullable.ExcludeFromCodeCoverage/NullableAttributes.cs +++ b/src/Nullable.ExcludeFromCodeCoverage/NullableAttributes.cs @@ -43,7 +43,6 @@ namespace System.Diagnostics.CodeAnalysis { using global::System; - using global::System.CodeDom.Compiler; /// /// Specifies that is allowed as an input even if the @@ -54,7 +53,7 @@ namespace System.Diagnostics.CodeAnalysis Inherited = false )] #if !NULLABLE_ATTRIBUTES_INCLUDE_IN_CODE_COVERAGE - [ExcludeFromCodeCoverage, DebuggerNonUserCode, GeneratedCode("https://www.nuget.org/packages/Nullable", "1.2.0")] + [ExcludeFromCodeCoverage, DebuggerNonUserCode] #endif internal sealed class AllowNullAttribute : Attribute { @@ -73,7 +72,7 @@ public AllowNullAttribute() { } Inherited = false )] #if !NULLABLE_ATTRIBUTES_INCLUDE_IN_CODE_COVERAGE - [ExcludeFromCodeCoverage, DebuggerNonUserCode, GeneratedCode("https://www.nuget.org/packages/Nullable", "1.2.0")] + [ExcludeFromCodeCoverage, DebuggerNonUserCode] #endif internal sealed class DisallowNullAttribute : Attribute { @@ -88,7 +87,7 @@ public DisallowNullAttribute() { } /// [AttributeUsage(AttributeTargets.Method, Inherited = false)] #if !NULLABLE_ATTRIBUTES_INCLUDE_IN_CODE_COVERAGE - [ExcludeFromCodeCoverage, DebuggerNonUserCode, GeneratedCode("https://www.nuget.org/packages/Nullable", "1.2.0")] + [ExcludeFromCodeCoverage, DebuggerNonUserCode] #endif internal sealed class DoesNotReturnAttribute : Attribute { @@ -104,7 +103,7 @@ public DoesNotReturnAttribute() { } /// [AttributeUsage(AttributeTargets.Parameter, Inherited = false)] #if !NULLABLE_ATTRIBUTES_INCLUDE_IN_CODE_COVERAGE - [ExcludeFromCodeCoverage, DebuggerNonUserCode, GeneratedCode("https://www.nuget.org/packages/Nullable", "1.2.0")] + [ExcludeFromCodeCoverage, DebuggerNonUserCode] #endif internal sealed class DoesNotReturnIfAttribute : Attribute { @@ -140,7 +139,7 @@ public DoesNotReturnIfAttribute(bool parameterValue) Inherited = false )] #if !NULLABLE_ATTRIBUTES_INCLUDE_IN_CODE_COVERAGE - [ExcludeFromCodeCoverage, DebuggerNonUserCode, GeneratedCode("https://www.nuget.org/packages/Nullable", "1.2.0")] + [ExcludeFromCodeCoverage, DebuggerNonUserCode] #endif internal sealed class MaybeNullAttribute : Attribute { @@ -156,7 +155,7 @@ public MaybeNullAttribute() { } /// [AttributeUsage(AttributeTargets.Parameter, Inherited = false)] #if !NULLABLE_ATTRIBUTES_INCLUDE_IN_CODE_COVERAGE - [ExcludeFromCodeCoverage, DebuggerNonUserCode, GeneratedCode("https://www.nuget.org/packages/Nullable", "1.2.0")] + [ExcludeFromCodeCoverage, DebuggerNonUserCode] #endif internal sealed class MaybeNullWhenAttribute : Attribute { @@ -189,7 +188,7 @@ public MaybeNullWhenAttribute(bool returnValue) Inherited = false )] #if !NULLABLE_ATTRIBUTES_INCLUDE_IN_CODE_COVERAGE - [ExcludeFromCodeCoverage, DebuggerNonUserCode, GeneratedCode("https://www.nuget.org/packages/Nullable", "1.2.0")] + [ExcludeFromCodeCoverage, DebuggerNonUserCode] #endif internal sealed class NotNullAttribute : Attribute { @@ -209,7 +208,7 @@ public NotNullAttribute() { } Inherited = false )] #if !NULLABLE_ATTRIBUTES_INCLUDE_IN_CODE_COVERAGE - [ExcludeFromCodeCoverage, DebuggerNonUserCode, GeneratedCode("https://www.nuget.org/packages/Nullable", "1.2.0")] + [ExcludeFromCodeCoverage, DebuggerNonUserCode] #endif internal sealed class NotNullIfNotNullAttribute : Attribute { @@ -243,7 +242,7 @@ public NotNullIfNotNullAttribute(string parameterName) /// [AttributeUsage(AttributeTargets.Parameter, Inherited = false)] #if !NULLABLE_ATTRIBUTES_INCLUDE_IN_CODE_COVERAGE - [ExcludeFromCodeCoverage, DebuggerNonUserCode, GeneratedCode("https://www.nuget.org/packages/Nullable", "1.2.0")] + [ExcludeFromCodeCoverage, DebuggerNonUserCode] #endif internal sealed class NotNullWhenAttribute : Attribute { diff --git a/src/Nullable.NoExcludeFromCodeCoverage/NullableAttributes.cs b/src/Nullable.NoExcludeFromCodeCoverage/NullableAttributes.cs index abd723b..964596e 100644 --- a/src/Nullable.NoExcludeFromCodeCoverage/NullableAttributes.cs +++ b/src/Nullable.NoExcludeFromCodeCoverage/NullableAttributes.cs @@ -43,7 +43,6 @@ namespace System.Diagnostics.CodeAnalysis { using global::System; - using global::System.CodeDom.Compiler; /// /// Specifies that is allowed as an input even if the @@ -54,7 +53,7 @@ namespace System.Diagnostics.CodeAnalysis Inherited = false )] #if !NULLABLE_ATTRIBUTES_INCLUDE_IN_CODE_COVERAGE - [DebuggerNonUserCode, GeneratedCode("https://www.nuget.org/packages/Nullable", "1.2.0")] + [DebuggerNonUserCode] #endif internal sealed class AllowNullAttribute : Attribute { @@ -73,7 +72,7 @@ public AllowNullAttribute() { } Inherited = false )] #if !NULLABLE_ATTRIBUTES_INCLUDE_IN_CODE_COVERAGE - [DebuggerNonUserCode, GeneratedCode("https://www.nuget.org/packages/Nullable", "1.2.0")] + [DebuggerNonUserCode] #endif internal sealed class DisallowNullAttribute : Attribute { @@ -88,7 +87,7 @@ public DisallowNullAttribute() { } /// [AttributeUsage(AttributeTargets.Method, Inherited = false)] #if !NULLABLE_ATTRIBUTES_INCLUDE_IN_CODE_COVERAGE - [DebuggerNonUserCode, GeneratedCode("https://www.nuget.org/packages/Nullable", "1.2.0")] + [DebuggerNonUserCode] #endif internal sealed class DoesNotReturnAttribute : Attribute { @@ -104,7 +103,7 @@ public DoesNotReturnAttribute() { } /// [AttributeUsage(AttributeTargets.Parameter, Inherited = false)] #if !NULLABLE_ATTRIBUTES_INCLUDE_IN_CODE_COVERAGE - [DebuggerNonUserCode, GeneratedCode("https://www.nuget.org/packages/Nullable", "1.2.0")] + [DebuggerNonUserCode] #endif internal sealed class DoesNotReturnIfAttribute : Attribute { @@ -140,7 +139,7 @@ public DoesNotReturnIfAttribute(bool parameterValue) Inherited = false )] #if !NULLABLE_ATTRIBUTES_INCLUDE_IN_CODE_COVERAGE - [DebuggerNonUserCode, GeneratedCode("https://www.nuget.org/packages/Nullable", "1.2.0")] + [DebuggerNonUserCode] #endif internal sealed class MaybeNullAttribute : Attribute { @@ -156,7 +155,7 @@ public MaybeNullAttribute() { } /// [AttributeUsage(AttributeTargets.Parameter, Inherited = false)] #if !NULLABLE_ATTRIBUTES_INCLUDE_IN_CODE_COVERAGE - [DebuggerNonUserCode, GeneratedCode("https://www.nuget.org/packages/Nullable", "1.2.0")] + [DebuggerNonUserCode] #endif internal sealed class MaybeNullWhenAttribute : Attribute { @@ -189,7 +188,7 @@ public MaybeNullWhenAttribute(bool returnValue) Inherited = false )] #if !NULLABLE_ATTRIBUTES_INCLUDE_IN_CODE_COVERAGE - [DebuggerNonUserCode, GeneratedCode("https://www.nuget.org/packages/Nullable", "1.2.0")] + [DebuggerNonUserCode] #endif internal sealed class NotNullAttribute : Attribute { @@ -209,7 +208,7 @@ public NotNullAttribute() { } Inherited = false )] #if !NULLABLE_ATTRIBUTES_INCLUDE_IN_CODE_COVERAGE - [DebuggerNonUserCode, GeneratedCode("https://www.nuget.org/packages/Nullable", "1.2.0")] + [DebuggerNonUserCode] #endif internal sealed class NotNullIfNotNullAttribute : Attribute { @@ -243,7 +242,7 @@ public NotNullIfNotNullAttribute(string parameterName) /// [AttributeUsage(AttributeTargets.Parameter, Inherited = false)] #if !NULLABLE_ATTRIBUTES_INCLUDE_IN_CODE_COVERAGE - [DebuggerNonUserCode, GeneratedCode("https://www.nuget.org/packages/Nullable", "1.2.0")] + [DebuggerNonUserCode] #endif internal sealed class NotNullWhenAttribute : Attribute { From 6d8d2dd9b05be50f271e545c2dbee82f3555d27f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20R=C3=B6mer?= <30902964+manuelroemer@users.noreply.github.com> Date: Tue, 24 Dec 2019 14:30:32 +0100 Subject: [PATCH 5/7] Updated comment wording. --- src/Nullable.ExcludeFromCodeCoverage/NullableAttributes.cs | 2 +- src/Nullable.NoExcludeFromCodeCoverage/NullableAttributes.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Nullable.ExcludeFromCodeCoverage/NullableAttributes.cs b/src/Nullable.ExcludeFromCodeCoverage/NullableAttributes.cs index b68c206..eb7b7e1 100644 --- a/src/Nullable.ExcludeFromCodeCoverage/NullableAttributes.cs +++ b/src/Nullable.ExcludeFromCodeCoverage/NullableAttributes.cs @@ -3,7 +3,7 @@ // Please see https://github.com/manuelroemer/Nullable for more information. // // IMPORTANT: -// NEVER DELETE THIS FILE if you are using a "packages.config" file to manage your NuGet references. +// DO NOT DELETE THIS FILE if you are using a "packages.config" file to manage your NuGet references. // Consider migrating to PackageReferences instead: // https://docs.microsoft.com/en-us/nuget/consume-packages/migrate-packages-config-to-package-reference // Migrating brings the following benefits: diff --git a/src/Nullable.NoExcludeFromCodeCoverage/NullableAttributes.cs b/src/Nullable.NoExcludeFromCodeCoverage/NullableAttributes.cs index 964596e..5de193d 100644 --- a/src/Nullable.NoExcludeFromCodeCoverage/NullableAttributes.cs +++ b/src/Nullable.NoExcludeFromCodeCoverage/NullableAttributes.cs @@ -3,7 +3,7 @@ // Please see https://github.com/manuelroemer/Nullable for more information. // // IMPORTANT: -// NEVER DELETE THIS FILE if you are using a "packages.config" file to manage your NuGet references. +// DO NOT DELETE THIS FILE if you are using a "packages.config" file to manage your NuGet references. // Consider migrating to PackageReferences instead: // https://docs.microsoft.com/en-us/nuget/consume-packages/migrate-packages-config-to-package-reference // Migrating brings the following benefits: From 05d3f1260d52eec4a3dbe11c5fba63e31fa533fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20R=C3=B6mer?= <30902964+manuelroemer@users.noreply.github.com> Date: Tue, 24 Dec 2019 14:41:44 +0100 Subject: [PATCH 6/7] Updated README for v1.2.0. --- README.md | 37 ++++++++++++++++--------------------- 1 file changed, 16 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index f5f27e5..bb2166e 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ have been added during the compilation. That is not the case for the library targeting .NET Standard 2.1, because the attributes are available through the .NET BCL there. This allows you to easily **multi-target** your projects without having to change a single line of -code. +code. | .NET Standard 2.0 | .NET Standard 2.1 | | ----------------- | ----------------- | @@ -57,14 +57,10 @@ install the package for your target framework. > :warning: **Important:**
> You **must** use C# 8.0 with the `Nullable` package - otherwise, your project won't compile. -> -> Currently, you can **not** use the package with a `packages.config` file. -> See [this issue](https://github.com/manuelroemer/Nullable/issues/1) for details.
-> You may use [this guide](https://docs.microsoft.com/en-us/nuget/consume-packages/migrate-packages-config-to-package-reference) -> to see how you can upgrade from a `packages.config` to package references. -The steps below will only work with the **new SDK `.csproj`** style! -Other installation guides can be found [here](https://github.com/manuelroemer/Nullable/wiki). +The steps below assume that you are using the **new SDK `.csproj`** style. +Please find installation guides and notes for other project types (for example `packages.config`) +[here](https://github.com/manuelroemer/Nullable/wiki). 1. **Reference the package**
Add the package to your project, for example via: @@ -84,6 +80,9 @@ Other installation guides can be found [here](https://github.com/manuelroemer/Nu all runtime; build; native; contentfiles; analyzers; buildtransitive + + + ``` This is especially important for libraries that are published to NuGet, because without this, @@ -97,7 +96,7 @@ Afterwards, you can immediately start using the attributes. ## Compiler Constants -The [included C# file](https://github.com/manuelroemer/Nullable/blob/master/src/Nullable/NullableAttributes.cs) +The [included C# file](https://github.com/manuelroemer/Nullable/blob/master/src/Nullable.ExcludeFromCodeCoverage/NullableAttributes.cs) makes use of some compiler constants that can be used to enable or disable certain features. ### `NULLABLE_ATTRIBUTES_DISABLE` @@ -109,20 +108,16 @@ In most cases, this should not be required, because the package automatically ex from target frameworks that already support these attributes. -### `NULLABLE_ATTRIBUTES_EXCLUDE_FROM_CODE_COVERAGE` - -Because the attributes are added as source code, they may appear in code coverage reports. +### `NULLABLE_ATTRIBUTES_INCLUDE_IN_CODE_COVERAGE` -By defining the `NULLABLE_ATTRIBUTES_EXCLUDE_FROM_CODE_COVERAGE` constant, the -[`ExcludeFromCodeCoverage`](https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.codeanalysis.excludefromcodecoverageattribute?view=netcore-3.0) -attribute gets added to the nullable attribute classes, thus preventing them from appearing in -the reports. +Because the attributes are added as source code, they could appear in code coverage reports. +By default, this is disabled via the [`ExcludeFromCodeCoverage`](https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.codeanalysis.excludefromcodecoverageattribute?view=netcore-3.0) +and [`DebuggerNonUserCode`](https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.debuggernonusercodeattribute?view=netcore-3.0) +attributes. -> :warning: **Important:**
-> This is disabled by default, because certain target frameworks like .NET Standard 1.7 don't -> support the [`ExcludeFromCodeCoverage`](https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.codeanalysis.excludefromcodecoverageattribute?view=netcore-3.0) -> attribute. -> Ensure that this attribute is supported by your target framework before defining this constant. +By defining the `NULLABLE_ATTRIBUTES_INCLUDE_IN_CODE_COVERAGE` constant, the [`ExcludeFromCodeCoverage`](https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.codeanalysis.excludefromcodecoverageattribute?view=netcore-3.0) +and [`DebuggerNonUserCode`](https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.debuggernonusercodeattribute?view=netcore-3.0) +attributes are not applied and the nullable attributes may therefore appear in code coverage reports. ## Building From a7430c4024200edc98bec7af4ba20cf9a771da43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20R=C3=B6mer?= <30902964+manuelroemer@users.noreply.github.com> Date: Tue, 24 Dec 2019 14:55:10 +0100 Subject: [PATCH 7/7] Updated CHANGELOG for v1.2.0. --- CHANGELOG.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 602884d..9fe3e00 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,34 @@ # Changelog +# v1.2.0 + +This release provides solutions for [issue #1](https://github.com/manuelroemer/Nullable/issues/1) and +[issue #6](https://github.com/manuelroemer/Nullable/issues/6). In addition, potential compiler +warnings in the `NullableAttributes.cs` file are now hidden. + +**Upgrading:** + +Remove any previously defined `NULLABLE_ATTRIBUTES_EXCLUDE_FROM_CODE_COVERAGE` compiler constant, +as it does not have any effect anymore. + +> :information_source: **Note:**
+> Builds will NOT break if the constant is still defined. It is simply ignored now. + +**Details:** + +* The package now supports `packages.config` via a `content/` folder in the NuGet package. +* The attributes are now excluded from code coverage by default. + When referenced from projects targeting .NET Standard >= 2.0 or .NET Framework >= 4.0, the + `ExcludeFromCodeCoverageAttribute` is used. For other project types, the `DebuggerNonUserCodeAttribute` + is used. +* Added support for the `NULLABLE_ATTRIBUTES_INCLUDE_IN_CODE_COVERAGE` compiler constant which + removes the code coverage attributes. +* The `NULLABLE_ATTRIBUTES_EXCLUDE_FROM_CODE_COVERAGE` compiler constant no longer has + any effects. Code coverage is now disabled by default. +* The `NullableAttributes.cs` file now wraps the attributes with a `#pragma warning disable` and + `#pragma warning restore` block to disable both compiler- and code-analysis warnings. + + # v1.1.1 This release adds the `// ` header to the `NullableAttributes.cs` file so that