提交 b98cf32a 编写于 作者: J jnm2

Fixed leading blank line in generated GlobalSuppressions.cs

上级 c32b2b21
......@@ -367,8 +367,8 @@ class Class2
</Project>
</Workspace>";
var addedGlobalSuppressions = $@"
// This file is used by Code Analysis to maintain SuppressMessage
var addedGlobalSuppressions =
$@"// This file is used by Code Analysis to maintain SuppressMessage
// attributes that are applied to this project.
// Project-level suppressions either have no target or are given
// a specific target and scoped to a namespace, type, member, etc.
......@@ -470,8 +470,8 @@ class Class2
</Project>
</Workspace>";
var addedGlobalSuppressions = $@"
// This file is used by Code Analysis to maintain SuppressMessage
var addedGlobalSuppressions =
$@"// This file is used by Code Analysis to maintain SuppressMessage
// attributes that are applied to this project.
// Project-level suppressions either have no target or are given
// a specific target and scoped to a namespace, type, member, etc.
......@@ -574,8 +574,8 @@ class Class2
</Project>
</Workspace>";
var addedGlobalSuppressionsProject1 = $@"
// This file is used by Code Analysis to maintain SuppressMessage
var addedGlobalSuppressionsProject1 =
$@"// This file is used by Code Analysis to maintain SuppressMessage
// attributes that are applied to this project.
// Project-level suppressions either have no target or are given
// a specific target and scoped to a namespace, type, member, etc.
......@@ -587,8 +587,8 @@ class Class2
".Replace("<", "&lt;").Replace(">", "&gt;");
var addedGlobalSuppressionsProject2 = $@"
// This file is used by Code Analysis to maintain SuppressMessage
var addedGlobalSuppressionsProject2 =
$@"// This file is used by Code Analysis to maintain SuppressMessage
// attributes that are applied to this project.
// Project-level suppressions either have no target or are given
// a specific target and scoped to a namespace, type, member, etc.
......@@ -697,8 +697,8 @@ class Class2
</Project>
</Workspace>";
var addedGlobalSuppressions = $@"
// This file is used by Code Analysis to maintain SuppressMessage
var addedGlobalSuppressions =
$@"// This file is used by Code Analysis to maintain SuppressMessage
// attributes that are applied to this project.
// Project-level suppressions either have no target or are given
// a specific target and scoped to a namespace, type, member, etc.
......
......@@ -808,8 +808,8 @@ public void AnalyzeNode(SyntaxNodeAnalysisContext context)
[Fact, Trait(Traits.Feature, Traits.Features.CodeActionsSuppression)]
public async Task GeneratedCodeShouldNotHaveTrailingWhitespace()
{
var expected = $@"
// This file is used by Code Analysis to maintain SuppressMessage
var expected =
$@"// This file is used by Code Analysis to maintain SuppressMessage
// attributes that are applied to this project.
// Project-level suppressions either have no target or are given
// a specific target and scoped to a namespace, type, member, etc.
......@@ -881,8 +881,7 @@ int Method()
int x = 0;
}
}",
$@"
// This file is used by Code Analysis to maintain SuppressMessage
$@"// This file is used by Code Analysis to maintain SuppressMessage
// attributes that are applied to this project.
// Project-level suppressions either have no target or are given
// a specific target and scoped to a namespace, type, member, etc.
......@@ -924,8 +923,7 @@ int Method()
}
}
}",
$@"
// This file is used by Code Analysis to maintain SuppressMessage
$@"// This file is used by Code Analysis to maintain SuppressMessage
// attributes that are applied to this project.
// Project-level suppressions either have no target or are given
// a specific target and scoped to a namespace, type, member, etc.
......@@ -973,8 +971,7 @@ int Method()
}
}
}",
$@"
// This file is used by Code Analysis to maintain SuppressMessage
$@"// This file is used by Code Analysis to maintain SuppressMessage
// attributes that are applied to this project.
// Project-level suppressions either have no target or are given
// a specific target and scoped to a namespace, type, member, etc.
......@@ -1025,8 +1022,7 @@ int Method()
}
}
}",
$@"
// This file is used by Code Analysis to maintain SuppressMessage
$@"// This file is used by Code Analysis to maintain SuppressMessage
// attributes that are applied to this project.
// Project-level suppressions either have no target or are given
// a specific target and scoped to a namespace, type, member, etc.
......@@ -1077,8 +1073,7 @@ class Class
}
}
}",
$@"
// This file is used by Code Analysis to maintain SuppressMessage
$@"// This file is used by Code Analysis to maintain SuppressMessage
// attributes that are applied to this project.
// Project-level suppressions either have no target or are given
// a specific target and scoped to a namespace, type, member, etc.
......@@ -1134,8 +1129,7 @@ int Method()
}
}
}",
$@"
// This file is used by Code Analysis to maintain SuppressMessage
$@"// This file is used by Code Analysis to maintain SuppressMessage
// attributes that are applied to this project.
// Project-level suppressions either have no target or are given
// a specific target and scoped to a namespace, type, member, etc.
......@@ -1194,8 +1188,7 @@ int Method()
}
}
}",
$@"
// This file is used by Code Analysis to maintain SuppressMessage
$@"// This file is used by Code Analysis to maintain SuppressMessage
// attributes that are applied to this project.
// Project-level suppressions either have no target or are given
// a specific target and scoped to a namespace, type, member, etc.
......@@ -1225,8 +1218,7 @@ class Class
}
}
}",
$@"
// This file is used by Code Analysis to maintain SuppressMessage
$@"// This file is used by Code Analysis to maintain SuppressMessage
// attributes that are applied to this project.
// Project-level suppressions either have no target or are given
// a specific target and scoped to a namespace, type, member, etc.
......@@ -1277,8 +1269,7 @@ class Class
}
}
}",
$@"
// This file is used by Code Analysis to maintain SuppressMessage
$@"// This file is used by Code Analysis to maintain SuppressMessage
// attributes that are applied to this project.
// Project-level suppressions either have no target or are given
// a specific target and scoped to a namespace, type, member, etc.
......@@ -1320,8 +1311,7 @@ class Class
{
[|int field = 0;|]
}",
$@"
// This file is used by Code Analysis to maintain SuppressMessage
$@"// This file is used by Code Analysis to maintain SuppressMessage
// attributes that are applied to this project.
// Project-level suppressions either have no target or are given
// a specific target and scoped to a namespace, type, member, etc.
......@@ -1362,8 +1352,7 @@ enum E
Field2
|]
}",
$@"
// This file is used by Code Analysis to maintain SuppressMessage
$@"// This file is used by Code Analysis to maintain SuppressMessage
// attributes that are applied to this project.
// Project-level suppressions either have no target or are given
// a specific target and scoped to a namespace, type, member, etc.
......@@ -1399,8 +1388,7 @@ class Class
{
int [|field = 0|], field2 = 1;
}",
$@"
// This file is used by Code Analysis to maintain SuppressMessage
$@"// This file is used by Code Analysis to maintain SuppressMessage
// attributes that are applied to this project.
// Project-level suppressions either have no target or are given
// a specific target and scoped to a namespace, type, member, etc.
......@@ -1447,8 +1435,7 @@ class Class
remove { }
}|]
}",
$@"
// This file is used by Code Analysis to maintain SuppressMessage
$@"// This file is used by Code Analysis to maintain SuppressMessage
// attributes that are applied to this project.
// Project-level suppressions either have no target or are given
// a specific target and scoped to a namespace, type, member, etc.
......@@ -1497,8 +1484,7 @@ class Class { }
[|class Class2|] { }
]]>
</Document>
<Document FilePath=""GlobalSuppressions.cs""><![CDATA[
// This file is used by Code Analysis to maintain SuppressMessage
<Document FilePath=""GlobalSuppressions.cs""><![CDATA[// This file is used by Code Analysis to maintain SuppressMessage
// attributes that are applied to this project.
// Project-level suppressions either have no target or are given
// a specific target and scoped to a namespace, type, member, etc.
......@@ -1509,8 +1495,7 @@ class Class { }
</Project>
</Workspace>";
var expectedText =
$@"
// This file is used by Code Analysis to maintain SuppressMessage
$@"// This file is used by Code Analysis to maintain SuppressMessage
// attributes that are applied to this project.
// Project-level suppressions either have no target or are given
// a specific target and scoped to a namespace, type, member, etc.
......@@ -1546,8 +1531,7 @@ class Class { }
</Project>
</Workspace>";
var expectedText =
$@"
// This file is used by Code Analysis to maintain SuppressMessage
$@"// This file is used by Code Analysis to maintain SuppressMessage
// attributes that are applied to this project.
// Project-level suppressions either have no target or are given
// a specific target and scoped to a namespace, type, member, etc.
......@@ -1579,8 +1563,7 @@ class Class { }
class Class { }
]]>
</Document>
<Document FilePath=""GlobalSuppressions2.cs""><![CDATA[
// This file is used by Code Analysis to maintain SuppressMessage
<Document FilePath=""GlobalSuppressions2.cs""><![CDATA[// This file is used by Code Analysis to maintain SuppressMessage
// attributes that are applied to this project.
// Project-level suppressions either have no target or are given
// a specific target and scoped to a namespace, type, member, etc.
......@@ -1591,8 +1574,7 @@ class Class { }
</Project>
</Workspace>";
var expectedText =
$@"
// This file is used by Code Analysis to maintain SuppressMessage
$@"// This file is used by Code Analysis to maintain SuppressMessage
// attributes that are applied to this project.
// Project-level suppressions either have no target or are given
// a specific target and scoped to a namespace, type, member, etc.
......@@ -1997,8 +1979,7 @@ int Method()
int x = 0;
}
}",
$@"
// This file is used by Code Analysis to maintain SuppressMessage
$@"// This file is used by Code Analysis to maintain SuppressMessage
// attributes that are applied to this project.
// Project-level suppressions either have no target or are given
// a specific target and scoped to a namespace, type, member, etc.
......
......@@ -980,8 +980,8 @@ Imports System
Dim x
End Sub
End Class]]>
Dim expected = $"
' This file is used by Code Analysis to maintain SuppressMessage
Dim expected =
$"' This file is used by Code Analysis to maintain SuppressMessage
' attributes that are applied to this project.
' Project-level suppressions either have no target or are given
' a specific target and scoped to a namespace, type, member, etc.
......@@ -1018,8 +1018,8 @@ Imports System
End Sub
End Class
End Namespace]]>
Dim expected = $"
' This file is used by Code Analysis to maintain SuppressMessage
Dim expected =
$"' This file is used by Code Analysis to maintain SuppressMessage
' attributes that are applied to this project.
' Project-level suppressions either have no target or are given
' a specific target and scoped to a namespace, type, member, etc.
......@@ -1060,8 +1060,8 @@ Namespace N1
End Class
End Namespace
End Namespace]]>
Dim expected = $"
' This file is used by Code Analysis to maintain SuppressMessage
Dim expected =
$"' This file is used by Code Analysis to maintain SuppressMessage
' attributes that are applied to this project.
' Project-level suppressions either have no target or are given
' a specific target and scoped to a namespace, type, member, etc.
......@@ -1104,8 +1104,8 @@ Namespace N
End Class
End Class
End Namespace]]>
Dim expected = $"
' This file is used by Code Analysis to maintain SuppressMessage
Dim expected =
$"' This file is used by Code Analysis to maintain SuppressMessage
' attributes that are applied to this project.
' Project-level suppressions either have no target or are given
' a specific target and scoped to a namespace, type, member, etc.
......@@ -1148,8 +1148,8 @@ Namespace N
End Class
End Class
End Namespace]]>
Dim expected = $"
' This file is used by Code Analysis to maintain SuppressMessage
Dim expected =
$"' This file is used by Code Analysis to maintain SuppressMessage
' attributes that are applied to this project.
' Project-level suppressions either have no target or are given
' a specific target and scoped to a namespace, type, member, etc.
......@@ -1196,8 +1196,8 @@ Namespace N
End Class
End Class
End Namespace]]>
Dim expected = $"
' This file is used by Code Analysis to maintain SuppressMessage
Dim expected =
$"' This file is used by Code Analysis to maintain SuppressMessage
' attributes that are applied to this project.
' Project-level suppressions either have no target or are given
' a specific target and scoped to a namespace, type, member, etc.
......@@ -1248,8 +1248,8 @@ Namespace N
End Class
End Class
End Namespace]]>
Dim expected = $"
' This file is used by Code Analysis to maintain SuppressMessage
Dim expected =
$"' This file is used by Code Analysis to maintain SuppressMessage
' attributes that are applied to this project.
' Project-level suppressions either have no target or are given
' a specific target and scoped to a namespace, type, member, etc.
......@@ -1298,8 +1298,8 @@ Namespace N
End Class
End Class
End Namespace]]>
Dim expected = $"
' This file is used by Code Analysis to maintain SuppressMessage
Dim expected =
$"' This file is used by Code Analysis to maintain SuppressMessage
' attributes that are applied to this project.
' Project-level suppressions either have no target or are given
' a specific target and scoped to a namespace, type, member, etc.
......@@ -1338,8 +1338,8 @@ Imports System
Class C
[|Private ReadOnly F As Integer|]
End Class]]>
Dim expected = $"
' This file is used by Code Analysis to maintain SuppressMessage
Dim expected =
$"' This file is used by Code Analysis to maintain SuppressMessage
' attributes that are applied to this project.
' Project-level suppressions either have no target or are given
' a specific target and scoped to a namespace, type, member, etc.
......@@ -1394,8 +1394,8 @@ Class C
End RemoveHandler
End Event
End Class]]>
Dim expected = $"
' This file is used by Code Analysis to maintain SuppressMessage
Dim expected =
$"' This file is used by Code Analysis to maintain SuppressMessage
' attributes that are applied to this project.
' Project-level suppressions either have no target or are given
' a specific target and scoped to a namespace, type, member, etc.
......@@ -1456,8 +1456,7 @@ End Class
[|Class Class2|]
End Class]]>
</Document>
<Document FilePath="GlobalSuppressions.vb"><![CDATA[
' This file is used by Code Analysis to maintain SuppressMessage
<Document FilePath="GlobalSuppressions.vb"><![CDATA[' This file is used by Code Analysis to maintain SuppressMessage
' attributes that are applied to this project.
' Project-level suppressions either have no target or are given
' a specific target and scoped to a namespace, type, member, etc.
......@@ -1468,8 +1467,8 @@ End Class]]>
</Project>
</Workspace>
Dim expected = $"
' This file is used by Code Analysis to maintain SuppressMessage
Dim expected =
$"' This file is used by Code Analysis to maintain SuppressMessage
' attributes that are applied to this project.
' Project-level suppressions either have no target or are given
' a specific target and scoped to a namespace, type, member, etc.
......@@ -1505,8 +1504,8 @@ End Class
</Project>
</Workspace>
Dim expected = $"
' This file is used by Code Analysis to maintain SuppressMessage
Dim expected =
$"' This file is used by Code Analysis to maintain SuppressMessage
' attributes that are applied to this project.
' Project-level suppressions either have no target or are given
' a specific target and scoped to a namespace, type, member, etc.
......@@ -1538,8 +1537,7 @@ Class Class3
End Class
]]>
</Document>
<Document FilePath="GlobalSuppressions2.vb"><![CDATA[
' This file is used by Code Analysis to maintain SuppressMessage
<Document FilePath="GlobalSuppressions2.vb"><![CDATA[' This file is used by Code Analysis to maintain SuppressMessage
' attributes that are applied to this project.
' Project-level suppressions either have no target or are given
' a specific target and scoped to a namespace, type, member, etc.
......@@ -1550,8 +1548,8 @@ End Class
</Project>
</Workspace>
Dim expected = $"
' This file is used by Code Analysis to maintain SuppressMessage
Dim expected =
$"' This file is used by Code Analysis to maintain SuppressMessage
' attributes that are applied to this project.
' Project-level suppressions either have no target or are given
' a specific target and scoped to a namespace, type, member, etc.
......
......@@ -20,8 +20,7 @@ internal abstract partial class AbstractSuppressionCodeFixProvider : IConfigurat
public const string SuppressMessageAttributeName = "System.Diagnostics.CodeAnalysis.SuppressMessage";
private const string s_globalSuppressionsFileName = "GlobalSuppressions";
private const string s_suppressionsFileCommentTemplate =
@"
{0} This file is used by Code Analysis to maintain SuppressMessage
@"{0} This file is used by Code Analysis to maintain SuppressMessage
{0} attributes that are applied to this project.
{0} Project-level suppressions either have no target or are given
{0} a specific target and scoped to a namespace, type, member, etc.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册