Fix warnings in external .NET projects
This commit is contained in:
parent
04fcf59afe
commit
65f5aecfa6
|
@ -3,6 +3,9 @@
|
|||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
<Import Project="../../Common.props" />
|
||||
<PropertyGroup>
|
||||
<NoWarn>$(NoWarn);SA1200</NoWarn>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.2" PrivateAssets="all" />
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="3.8.0" PrivateAssets="all" />
|
||||
|
|
|
@ -31,7 +31,7 @@ namespace BizHawk.SrcGen.ReflectionCache
|
|||
private string CalcNamespace()
|
||||
{
|
||||
// black magic wizardry to find common prefix https://stackoverflow.com/a/35081977
|
||||
var ns = new string(_namespaces.First()
|
||||
var ns = new string(_namespaces[0]
|
||||
.Substring(0, _namespaces.Min(s => s.Length))
|
||||
.TakeWhile((c, i) => _namespaces.All(s => s[i] == c))
|
||||
.ToArray());
|
||||
|
@ -44,7 +44,7 @@ namespace BizHawk.SrcGen.ReflectionCache
|
|||
{
|
||||
SimpleNameSyntax simple => simple.Identifier.ValueText,
|
||||
QualifiedNameSyntax qual => $"{Ser(qual.Left)}.{Ser(qual.Right)}",
|
||||
_ => throw new Exception()
|
||||
_ => throw new InvalidOperationException()
|
||||
};
|
||||
if (_namespace != null || syntaxNode is not NamespaceDeclarationSyntax syn) return;
|
||||
var newNS = Ser(syn.Name);
|
||||
|
|
|
@ -3,4 +3,7 @@
|
|||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
<Import Project="../../Common.props" />
|
||||
<PropertyGroup>
|
||||
<Nullable>disable</Nullable>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue