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> <SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup> </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> <ItemGroup>
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleToAttribute"> <AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleToAttribute">
<_Parameter1>$(AssemblyName).Tests</_Parameter1> <_Parameter1>$(AssemblyName).Tests</_Parameter1>

View File

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

View File

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