Skip to content

Commit

Permalink
Bump Roslynator analyzers to 4.11.0 (#1408)
Browse files Browse the repository at this point in the history
  • Loading branch information
josefpihrt committed Feb 20, 2024
1 parent 152e88a commit 9f1cea7
Show file tree
Hide file tree
Showing 112 changed files with 2,531 additions and 2,532 deletions.
Expand Up @@ -26,7 +26,7 @@ public ImplementNonGenericCounterpartCodeFixProvider()

internal readonly string ExplicitEquivalenceKey;

private const string IComparableCompareText = @"
private const string IComparableCompareText = """
public int global::System.IComparable.CompareTo(object obj)
{
if (obj == null)
Expand All @@ -39,11 +39,11 @@ public ImplementNonGenericCounterpartCodeFixProvider()
return CompareTo(x);
}

throw new global::System.ArgumentException("""", nameof(obj));
throw new global::System.ArgumentException("", nameof(obj));
}
";
""";

private const string IComparerCompareText = @"
private const string IComparerCompareText = """
public int global::System.Collections.IComparer.Compare(object x, object y)
{
if (x == y)
Expand All @@ -67,11 +67,11 @@ public ImplementNonGenericCounterpartCodeFixProvider()
return Compare(a, b);
}

throw new global::System.ArgumentException("""", nameof(x));
throw new global::System.ArgumentException("", nameof(x));
}
";
""";

private const string IEqualityComparerEqualsText = @"
private const string IEqualityComparerEqualsText = """
new public bool global::System.Collections.IEqualityComparer.Equals(object x, object y)
{
if (x == y)
Expand All @@ -90,11 +90,11 @@ public ImplementNonGenericCounterpartCodeFixProvider()
return Equals(a, b);
}

throw new global::System.ArgumentException("""", nameof(x));
throw new global::System.ArgumentException("", nameof(x));
}
";
""";

private const string IEqualityComparerGetHashCodeText = @"
private const string IEqualityComparerGetHashCodeText = """
public int global::System.Collections.IEqualityComparer.GetHashCode(object obj)
{
if (obj == null)
Expand All @@ -107,9 +107,9 @@ public ImplementNonGenericCounterpartCodeFixProvider()
return GetHashCode(x);
}

throw new global::System.ArgumentException("""", nameof(obj));
throw new global::System.ArgumentException("", nameof(obj));
}
";
""";

private static readonly Lazy<MethodDeclarationSyntax> _lazyIComparableCompare = new(() => CreateMethodDeclaration(IComparableCompareText, explicitInterfaceImplementation: false));
private static readonly Lazy<MethodDeclarationSyntax> _lazyIComparerCompare = new(() => CreateMethodDeclaration(IComparerCompareText, explicitInterfaceImplementation: false));
Expand Down
6 changes: 3 additions & 3 deletions src/CommandLine/Html/SymbolDefinitionHtmlWriter.cs
Expand Up @@ -66,14 +66,14 @@ public override void WriteStartDocument()
WriteAttributeString("charset", "utf-8");
WriteEndElement();
#if DEBUG
_writer.WriteRaw(@"
<style type=""text/css"">
_writer.WriteRaw("""
<style type="text/css">
* { font-family: Consolas, Courier; }
.containing-namespace { color: gray; }
.external-type { color: gray; }
.type-hierarchy-link { text-decoration: none; }
</style>
");
""");
#endif
WriteEndElement();
WriteStartElement("body");
Expand Down
2 changes: 1 addition & 1 deletion src/Directory.Build.props
Expand Up @@ -33,7 +33,7 @@
<Version Condition="'$(Version)' == ''">1.0.0</Version>
<RoslynatorCliRoslynVersion>4.8.0</RoslynatorCliRoslynVersion>
<RoslynatorTestingRoslynVersion>4.8.0</RoslynatorTestingRoslynVersion>
<RoslynatorAnalyzersPackageReferenceVersion>4.10.0</RoslynatorAnalyzersPackageReferenceVersion>
<RoslynatorAnalyzersPackageReferenceVersion>4.11.0</RoslynatorAnalyzersPackageReferenceVersion>
<RoslynatorCliPackageVersion>$(RoslynatorCliVersion)</RoslynatorCliPackageVersion>
<RoslynatorPackageVersion>$(Version)</RoslynatorPackageVersion>
<RoslynatorVersion>$(RoslynatorPackageVersion)</RoslynatorVersion>
Expand Down
10 changes: 5 additions & 5 deletions src/Tests/Analyzers.Tests/RCS1007AddBracesTests.cs
Expand Up @@ -223,31 +223,31 @@ void M(object x, object y)
[Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBraces)]
public async Task Test_ForeachTuple()
{
await VerifyDiagnosticAndFixAsync(@"
await VerifyDiagnosticAndFixAsync("""
class C
{
void M(object x, object y)
{
foreach ((string, string) item in new [] { ("""","""") })
foreach ((string, string) item in new [] { ("","") })
[|M(
x,
y);|]
}
}
", @"
""", """
class C
{
void M(object x, object y)
{
foreach ((string, string) item in new [] { ("""","""") })
foreach ((string, string) item in new [] { ("","") })
{
M(
x,
y);
}
}
}
");
""");
}

[Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.AddBraces)]
Expand Down
24 changes: 12 additions & 12 deletions src/Tests/Analyzers.Tests/RCS1013UsePredefinedTypeTests.cs
Expand Up @@ -15,14 +15,14 @@ public class RCS1013UsePredefinedTypeTests : AbstractCSharpDiagnosticVerifier<Us
[Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UsePredefinedType)]
public async Task Test()
{
await VerifyDiagnosticAndFixAsync(@"
await VerifyDiagnosticAndFixAsync("""
using System;
using System.Collections.Generic;

/// <summary>
/// <see cref=""[|String|]""/>
/// <see cref=""[|System.String|]""/>
/// <see cref=""[|global::System.String|]""/>
/// <see cref="[|String|]"/>
/// <see cref="[|System.String|]"/>
/// <see cref="[|global::System.String|]"/>
/// </summary>
class C
{
Expand All @@ -41,14 +41,14 @@ void M([|String|] x)
x = nameof(Dictionary<[|System.String|], [|global::System.String|]>);
}
}
", @"
""", """
using System;
using System.Collections.Generic;

/// <summary>
/// <see cref=""string""/>
/// <see cref=""string""/>
/// <see cref=""string""/>
/// <see cref="string"/>
/// <see cref="string"/>
/// <see cref="string"/>
/// </summary>
class C
{
Expand All @@ -67,7 +67,7 @@ void M(string x)
x = nameof(Dictionary<string, string>);
}
}
");
""");
}

[Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UsePredefinedType)]
Expand Down Expand Up @@ -97,12 +97,12 @@ void M(string? x)
[Fact, Trait(Traits.Analyzer, DiagnosticIdentifiers.UsePredefinedType)]
public async Task TestNoDiagnostic()
{
await VerifyNoDiagnosticAsync(@"
await VerifyNoDiagnosticAsync("""
using System;
using s = System.String;

/// <summary>
/// <see cref=""s""/>
/// <see cref="s"/>
/// </summary>
class C
{
Expand All @@ -115,6 +115,6 @@ void M(string x)
x = nameof(global::System.String);
}
}
");
""");
}
}

0 comments on commit 9f1cea7

Please sign in to comment.