Skip to content

Commit f376b0b

Browse files
committed
fix CA warnings
1 parent ebdaf53 commit f376b0b

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

tests/Smdn.Reflection.ReverseGenerating.ListApi.Core/Smdn.Reflection.ReverseGenerating.ListApi/ApiListWriter.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,9 @@ private static void CreateAssemblyFromSourceCode(
106106
var span = diag.Location.GetLineSpan();
107107
var location = $"{span.Path}({span.StartLinePosition.Line + 1},{span.StartLinePosition.Character + 1})";
108108

109+
#pragma warning disable CA1305 // cannot pass IFormatProvider
109110
TestContext.WriteLine($"{TestContext.CurrentContext.Test.FullName} {location}: {diag.Severity} {diag.Id}: {diag.GetMessage()}");
111+
#pragma warning restore CA1305
110112
}
111113

112114
if (!emitResult.Success)

tests/Smdn.Reflection.ReverseGenerating/Smdn.Reflection.ReverseGenerating/Generator.GenerateAttributeList.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,10 @@ private static System.Collections.IEnumerable YieldTestCases_GenerateAttributeLi
9090
}
9191
catch (IndexOutOfRangeException) {
9292
// Mono bug: https://github.com/dotnet/runtime/issues/72907
93-
if (RuntimeInformation.FrameworkDescription.StartsWith("Mono ") || RuntimeInformation.FrameworkDescription.StartsWith(".NET Framework ")) {
93+
if (
94+
RuntimeInformation.FrameworkDescription.StartsWith("Mono ", StringComparison.OrdinalIgnoreCase) ||
95+
RuntimeInformation.FrameworkDescription.StartsWith(".NET Framework ", StringComparison.OrdinalIgnoreCase)
96+
) {
9497
if (p.CustomAttributes.Count() == 0)
9598
return Enumerable.Empty<object[]>();
9699
}

tests/Smdn.Reflection.ReverseGenerating/Smdn.Reflection.ReverseGenerating/Generator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ private static IEnumerable<Type> GetTestCaseTypes()
1616
=> Assembly
1717
.GetExecutingAssembly()
1818
.GetTypes()
19-
.Where(static t => t.FullName!.StartsWith(GeneratorTestCases.NS.Namespace));
19+
.Where(static t => t.FullName!.StartsWith(GeneratorTestCases.NS.Namespace, StringComparison.Ordinal));
2020

2121
internal static bool ExceptTestCaseAttributeFilter(Type type, ICustomAttributeProvider _)
2222
=> !typeof(ITestCaseAttribute).IsAssignableFrom(type);

0 commit comments

Comments
 (0)