Skip to content

Commit 385264e

Browse files
committed
Fix all violations of SA1413 (Use trailing comma in multi-line initializers)
1 parent 2f436ab commit 385264e

136 files changed

Lines changed: 386 additions & 386 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

StyleCop.Analyzers/StyleCop.Analyzers.CodeFixes/Helpers/SpecialTypeHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ internal static class SpecialTypeHelper
2828
[SpecialType.System_String] = SyntaxFactory.PredefinedType(SyntaxFactory.Token(SyntaxKind.StringKeyword)),
2929
[SpecialType.System_UInt16] = SyntaxFactory.PredefinedType(SyntaxFactory.Token(SyntaxKind.UShortKeyword)),
3030
[SpecialType.System_UInt32] = SyntaxFactory.PredefinedType(SyntaxFactory.Token(SyntaxKind.UIntKeyword)),
31-
[SpecialType.System_UInt64] = SyntaxFactory.PredefinedType(SyntaxFactory.Token(SyntaxKind.ULongKeyword))
31+
[SpecialType.System_UInt64] = SyntaxFactory.PredefinedType(SyntaxFactory.Token(SyntaxKind.ULongKeyword)),
3232
}.ToImmutableDictionary();
3333

3434
public static bool IsPredefinedType(SpecialType specialType)

StyleCop.Analyzers/StyleCop.Analyzers.CodeFixes/LayoutRules/SA1505CodeFixProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ private static async Task<Document> GetTransformedDocumentAsync(Document documen
7979
var replaceMap = new Dictionary<SyntaxToken, SyntaxToken>()
8080
{
8181
[openBraceToken] = openBraceToken.WithTrailingTrivia(triviaList.Take(firstEndOfLineIndex + 1)),
82-
[nextToken] = nextToken.WithLeadingTrivia(triviaList.Skip(lastEndOfLineIndex + 1))
82+
[nextToken] = nextToken.WithLeadingTrivia(triviaList.Skip(lastEndOfLineIndex + 1)),
8383
};
8484

8585
var newSyntaxRoot = syntaxRoot.ReplaceTokens(replaceMap.Keys, (t1, t2) => replaceMap[t1]);

StyleCop.Analyzers/StyleCop.Analyzers.CodeFixes/LayoutRules/SA1508CodeFixProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ private static async Task<Document> GetTransformedDocumentAsync(Document documen
8888
var replaceMap = new Dictionary<SyntaxToken, SyntaxToken>()
8989
{
9090
[previousToken] = previousToken.WithTrailingTrivia(triviaList.Take(lastEndOfLineIndex + 1)),
91-
[closeBraceToken] = closeBraceToken.WithLeadingTrivia(triviaList.Skip(firstLeadingWhitespace))
91+
[closeBraceToken] = closeBraceToken.WithLeadingTrivia(triviaList.Skip(firstLeadingWhitespace)),
9292
};
9393

9494
var newSyntaxRoot = syntaxRoot.ReplaceTokens(replaceMap.Keys, (t1, t2) => replaceMap[t1]);

StyleCop.Analyzers/StyleCop.Analyzers.CodeFixes/ReadabilityRules/SA1102CodeFixProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ private static async Task<Document> GetTransformedDocumentAsync(Document documen
6060
var replaceMap = new Dictionary<SyntaxToken, SyntaxToken>()
6161
{
6262
[precedingToken] = precedingToken.WithTrailingTrivia(SyntaxFactory.CarriageReturnLineFeed),
63-
[token] = token.WithLeadingTrivia(indentationTrivia)
63+
[token] = token.WithLeadingTrivia(indentationTrivia),
6464
};
6565

6666
var newSyntaxRoot = syntaxRoot.ReplaceTokens(replaceMap.Keys, (t1, t2) => replaceMap[t1]).WithoutFormatting();

StyleCop.Analyzers/StyleCop.Analyzers.CodeFixes/ReadabilityRules/SA1104SA1105CodeFixProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ private static async Task<Document> GetTransformedDocumentAsync(Document documen
6464
var replaceMap = new Dictionary<SyntaxToken, SyntaxToken>()
6565
{
6666
[precedingToken] = precedingToken.WithTrailingTrivia(processedTriviaList),
67-
[token] = token.WithLeadingTrivia(indentationTrivia)
67+
[token] = token.WithLeadingTrivia(indentationTrivia),
6868
};
6969

7070
var newSyntaxRoot = syntaxRoot.ReplaceTokens(replaceMap.Keys, (t1, t2) => replaceMap[t1]).WithoutFormatting();

StyleCop.Analyzers/StyleCop.Analyzers.CodeFixes/ReadabilityRules/SA1139CodeFixProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ internal class SA1139CodeFixProvider : CodeFixProvider
3232
{ SyntaxKind.UIntKeyword, "U" },
3333
{ SyntaxKind.FloatKeyword, "F" },
3434
{ SyntaxKind.DoubleKeyword, "D" },
35-
{ SyntaxKind.DecimalKeyword, "M" }
35+
{ SyntaxKind.DecimalKeyword, "M" },
3636
};
3737

3838
private static readonly char[] LettersAllowedInLiteralSuffix = LiteralSyntaxKindToSuffix.Values

StyleCop.Analyzers/StyleCop.Analyzers.CodeFixes/SpacingRules/SA1018CodeFixProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ private static async Task<Document> GetTransformedDocumentAsync(Document documen
9797
var replaceMap = new Dictionary<SyntaxToken, SyntaxToken>()
9898
{
9999
[precedingToken] = precedingToken.WithTrailingTrivia(correctedTriviaList),
100-
[questionToken] = questionToken.WithLeadingTrivia()
100+
[questionToken] = questionToken.WithLeadingTrivia(),
101101
};
102102

103103
var newSyntaxRoot = syntaxRoot.ReplaceTokens(replaceMap.Keys, (t1, t2) => replaceMap[t1]);

StyleCop.Analyzers/StyleCop.Analyzers.Test/DocumentationRules/SA1600UnitTests.cs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ private async Task TestTypeDeclarationDocumentationAsync(string type, string mod
450450

451451
DiagnosticResult[] expected =
452452
{
453-
this.CSharpDiagnostic().WithLocation(3, 1)
453+
this.CSharpDiagnostic().WithLocation(3, 1),
454454
};
455455

456456
await this.VerifyCSharpDiagnosticAsync(string.Format(hasDocumentation ? testCodeWithDocumentation : testCodeWithoutDocumentation, modifiers, type), requiresDiagnostic ? expected : EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(false);
@@ -483,7 +483,7 @@ public class OuterClass
483483

484484
DiagnosticResult[] expected =
485485
{
486-
this.CSharpDiagnostic().WithLocation(8, 5)
486+
this.CSharpDiagnostic().WithLocation(8, 5),
487487
};
488488

489489
await this.VerifyCSharpDiagnosticAsync(string.Format(hasDocumentation ? testCodeWithDocumentation : testCodeWithoutDocumentation, modifiers, type), requiresDiagnostic ? expected : EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(false);
@@ -500,7 +500,7 @@ private async Task TestDelegateDeclarationDocumentationAsync(string modifiers, b
500500

501501
DiagnosticResult[] expected =
502502
{
503-
this.CSharpDiagnostic().WithLocation(3, 1)
503+
this.CSharpDiagnostic().WithLocation(3, 1),
504504
};
505505

506506
await this.VerifyCSharpDiagnosticAsync(string.Format(hasDocumentation ? testCodeWithDocumentation : testCodeWithoutDocumentation, modifiers), requiresDiagnostic ? expected : EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(false);
@@ -529,7 +529,7 @@ public class OuterClass
529529

530530
DiagnosticResult[] expected =
531531
{
532-
this.CSharpDiagnostic().WithLocation(8, 5)
532+
this.CSharpDiagnostic().WithLocation(8, 5),
533533
};
534534

535535
await this.VerifyCSharpDiagnosticAsync(string.Format(hasDocumentation ? testCodeWithDocumentation : testCodeWithoutDocumentation, modifiers), requiresDiagnostic ? expected : EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(false);
@@ -570,7 +570,7 @@ public interface IInterface {{ void MemberName(); }}
570570

571571
DiagnosticResult[] expected =
572572
{
573-
this.CSharpDiagnostic().WithLocation(8, 5)
573+
this.CSharpDiagnostic().WithLocation(8, 5),
574574
};
575575

576576
string explicitInterfaceText = isExplicitInterfaceMethod ? " IInterface." : string.Empty;
@@ -600,7 +600,7 @@ public interface InterfaceName
600600

601601
DiagnosticResult[] expected =
602602
{
603-
this.CSharpDiagnostic().WithLocation(8, 5)
603+
this.CSharpDiagnostic().WithLocation(8, 5),
604604
};
605605

606606
await this.VerifyCSharpDiagnosticAsync(hasDocumentation ? testCodeWithDocumentation : testCodeWithoutDocumentation, !hasDocumentation ? expected : EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(false);
@@ -635,7 +635,7 @@ string MemberName
635635

636636
DiagnosticResult[] expected =
637637
{
638-
this.CSharpDiagnostic().WithLocation(8, 12)
638+
this.CSharpDiagnostic().WithLocation(8, 12),
639639
};
640640

641641
await this.VerifyCSharpDiagnosticAsync(hasDocumentation ? testCodeWithDocumentation : testCodeWithoutDocumentation, !hasDocumentation ? expected : EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(false);
@@ -664,7 +664,7 @@ public interface InterfaceName
664664

665665
DiagnosticResult[] expected =
666666
{
667-
this.CSharpDiagnostic().WithLocation(8, 25)
667+
this.CSharpDiagnostic().WithLocation(8, 25),
668668
};
669669

670670
await this.VerifyCSharpDiagnosticAsync(hasDocumentation ? testCodeWithDocumentation : testCodeWithoutDocumentation, !hasDocumentation ? expected : EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(false);
@@ -693,7 +693,7 @@ public interface InterfaceName
693693

694694
DiagnosticResult[] expected =
695695
{
696-
this.CSharpDiagnostic().WithLocation(8, 5)
696+
this.CSharpDiagnostic().WithLocation(8, 5),
697697
};
698698

699699
await this.VerifyCSharpDiagnosticAsync(hasDocumentation ? testCodeWithDocumentation : testCodeWithoutDocumentation, !hasDocumentation ? expected : EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(false);
@@ -726,7 +726,7 @@ public class OuterClass
726726

727727
DiagnosticResult[] expected =
728728
{
729-
this.CSharpDiagnostic().WithLocation(8, 5)
729+
this.CSharpDiagnostic().WithLocation(8, 5),
730730
};
731731

732732
await this.VerifyCSharpDiagnosticAsync(string.Format(hasDocumentation ? testCodeWithDocumentation : testCodeWithoutDocumentation, modifiers), requiresDiagnostic ? expected : EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(false);
@@ -757,7 +757,7 @@ public class OuterClass
757757

758758
DiagnosticResult[] expected =
759759
{
760-
this.CSharpDiagnostic().WithLocation(7, 6)
760+
this.CSharpDiagnostic().WithLocation(7, 6),
761761
};
762762

763763
await this.VerifyCSharpDiagnosticAsync(string.Format(hasDocumentation ? testCodeWithDocumentation : testCodeWithoutDocumentation), requiresDiagnostic ? expected : EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(false);
@@ -796,7 +796,7 @@ public interface IInterface {{ string MemberName {{ get; set; }} }}
796796

797797
DiagnosticResult[] expected =
798798
{
799-
this.CSharpDiagnostic().WithLocation(9, 5)
799+
this.CSharpDiagnostic().WithLocation(9, 5),
800800
};
801801

802802
string explicitInterfaceText = isExplicitInterfaceProperty ? " IInterface." : string.Empty;
@@ -836,7 +836,7 @@ public interface IInterface {{ string this[string key] {{ get; set; }} }}
836836

837837
DiagnosticResult[] expected =
838838
{
839-
this.CSharpDiagnostic().WithLocation(9, 5)
839+
this.CSharpDiagnostic().WithLocation(9, 5),
840840
};
841841

842842
string explicitInterfaceText = isExplicitInterfaceIndexer ? " IInterface." : string.Empty;
@@ -898,7 +898,7 @@ public interface IInterface {{ event System.Action MyEvent; }}
898898

899899
DiagnosticResult[] expected =
900900
{
901-
this.CSharpDiagnostic().WithLocation(10, 5)
901+
this.CSharpDiagnostic().WithLocation(10, 5),
902902
};
903903

904904
string explicitInterfaceText = isExplicitInterfaceEvent ? " IInterface." : string.Empty;
@@ -928,7 +928,7 @@ public class OuterClass
928928

929929
DiagnosticResult[] expected =
930930
{
931-
this.CSharpDiagnostic().WithLocation(8, 19)
931+
this.CSharpDiagnostic().WithLocation(8, 19),
932932
};
933933

934934
await this.VerifyCSharpDiagnosticAsync(string.Format(hasDocumentation ? testCodeWithDocumentation : testCodeWithoutDocumentation, modifiers), requiresDiagnostic ? expected : EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(false);
@@ -957,7 +957,7 @@ public class OuterClass
957957

958958
DiagnosticResult[] expected =
959959
{
960-
this.CSharpDiagnostic().WithLocation(8, 19)
960+
this.CSharpDiagnostic().WithLocation(8, 19),
961961
};
962962

963963
await this.VerifyCSharpDiagnosticAsync(string.Format(hasDocumentation ? testCodeWithDocumentation : testCodeWithoutDocumentation, modifiers), requiresDiagnostic ? expected : EmptyDiagnosticResults, CancellationToken.None).ConfigureAwait(false);

StyleCop.Analyzers/StyleCop.Analyzers.Test/DocumentationRules/SA1611UnitTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ public static explicit operator TestClass(int value)
224224
DiagnosticResult[] expected =
225225
{
226226
this.CSharpDiagnostic().WithLocation(10, 50).WithArguments("value"),
227-
this.CSharpDiagnostic().WithLocation(18, 51).WithArguments("value")
227+
this.CSharpDiagnostic().WithLocation(18, 51).WithArguments("value"),
228228
};
229229

230230
await this.VerifyCSharpDiagnosticAsync(testCode, expected, CancellationToken.None).ConfigureAwait(false);

StyleCop.Analyzers/StyleCop.Analyzers.Test/DocumentationRules/SA1612UnitTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public class ClassName
101101
var expected = new[]
102102
{
103103
this.CSharpDiagnostic().WithLocation(10, 21).WithArguments("boo"),
104-
this.CSharpDiagnostic().WithLocation(11, 21).WithArguments("far")
104+
this.CSharpDiagnostic().WithLocation(11, 21).WithArguments("far"),
105105
};
106106

107107
await this.VerifyCSharpDiagnosticAsync(testCode.Replace("$$", declaration), expected, CancellationToken.None).ConfigureAwait(false);
@@ -153,7 +153,7 @@ public class ClassName
153153
var expected = new[]
154154
{
155155
diagnostic.WithLocation(10, 22).WithArguments("bar", 2),
156-
diagnostic.WithLocation(11, 22).WithArguments("foo", 1)
156+
diagnostic.WithLocation(11, 22).WithArguments("foo", 1),
157157
};
158158

159159
await this.VerifyCSharpDiagnosticAsync(testCode.Replace("$$", p), expected, CancellationToken.None).ConfigureAwait(false);
@@ -248,7 +248,7 @@ public class ClassName
248248
var expected = new[]
249249
{
250250
this.CSharpDiagnostic().WithLocation(8, 22).WithArguments("boo"),
251-
this.CSharpDiagnostic().WithLocation(8, 22).WithArguments("far")
251+
this.CSharpDiagnostic().WithLocation(8, 22).WithArguments("far"),
252252
};
253253

254254
await this.VerifyCSharpDiagnosticAsync(testCode, expected, CancellationToken.None).ConfigureAwait(false);

0 commit comments

Comments
 (0)