Disable nullability checks for older target frameworks

This commit is contained in:
Alexey Golub
2020-04-20 16:52:51 +03:00
parent 65b66b0d27
commit 698629b153
3 changed files with 10 additions and 5 deletions

View File

@@ -18,6 +18,11 @@
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup>
<!-- Disable nullability warnings on older frameworks because there is no nullability info for BCL -->
<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'net45'">
<Nullable>annotations</Nullable>
</PropertyGroup>
<ItemGroup>
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleToAttribute">
<_Parameter1>$(AssemblyName).Tests</_Parameter1>

View File

@@ -210,8 +210,8 @@ namespace CliFx.Domain
type,
attribute?.Name,
attribute?.Description,
parameters,
options
parameters!,
options!
);
}
}

View File

@@ -279,9 +279,9 @@ namespace CliFx.Domain
foreach (var childCommand in childCommands)
{
var relativeCommandName =
string.IsNullOrWhiteSpace(childCommand.Name) || string.IsNullOrWhiteSpace(command.Name)
? childCommand.Name
: childCommand.Name.Substring(command.Name.Length + 1);
!string.IsNullOrWhiteSpace(command.Name)
? childCommand.Name!.Substring(command.Name.Length + 1)
: childCommand.Name!;
// Name
RenderIndent();