diff --git a/analyzers/its/Projects/Net6/Net6/Net6.csproj b/analyzers/its/Projects/Net6/Net6/Net6.csproj deleted file mode 100644 index e99cbed7a15..00000000000 --- a/analyzers/its/Projects/Net6/Net6/Net6.csproj +++ /dev/null @@ -1,15 +0,0 @@ - - - - Exe - net6.0 - enable - disable - True - - - - - - - diff --git a/analyzers/its/Projects/Net6/Net6/Program.cs b/analyzers/its/Projects/Net6/Net6/Program.cs deleted file mode 100644 index 4ff85c722e6..00000000000 --- a/analyzers/its/Projects/Net6/Net6/Program.cs +++ /dev/null @@ -1,3 +0,0 @@ -// Next line triggers S1481 to make sure issues are raised -var foo = 42; -Console.WriteLine("Hello, World!"); diff --git a/analyzers/its/Projects/Net7/Net7/Program.cs b/analyzers/its/Projects/Net7/Net7/Program.cs deleted file mode 100644 index 4ff85c722e6..00000000000 --- a/analyzers/its/Projects/Net7/Net7/Program.cs +++ /dev/null @@ -1,3 +0,0 @@ -// Next line triggers S1481 to make sure issues are raised -var foo = 42; -Console.WriteLine("Hello, World!"); diff --git a/analyzers/its/Projects/Net8/Net8/Program.cs b/analyzers/its/Projects/Net8/Net8/Program.cs deleted file mode 100644 index 4ff85c722e6..00000000000 --- a/analyzers/its/Projects/Net8/Net8/Program.cs +++ /dev/null @@ -1,3 +0,0 @@ -// Next line triggers S1481 to make sure issues are raised -var foo = 42; -Console.WriteLine("Hello, World!"); diff --git a/analyzers/its/Projects/NetCore31/NetCore31/Program.cs b/analyzers/its/Projects/NetCore31/NetCore31/Program.cs deleted file mode 100644 index bd2b95544dd..00000000000 --- a/analyzers/its/Projects/NetCore31/NetCore31/Program.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; - -namespace NetCore31 -{ - class Program - { - static void Main(string[] args) - { - // Next line triggers S1481 to make sure issues are raised - var foo = 42; - Console.WriteLine("Hello World!"); - } - } -} diff --git a/analyzers/its/expected/Net6/S1451-Net6-net6.0.json b/analyzers/its/expected/Net6/S1451-Net6-net6.0.json deleted file mode 100644 index d9a1310601d..00000000000 --- a/analyzers/its/expected/Net6/S1451-Net6-net6.0.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "Issues": [ - { - "Id": "S1451", - "Message": "Add or update the header of this file.", - "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/Net6/Net6/Program.cs#L1", - "Location": "Line 1 Position 1-1" - } - ] -} \ No newline at end of file diff --git a/analyzers/its/expected/Net6/S1481-Net6-net6.0.json b/analyzers/its/expected/Net6/S1481-Net6-net6.0.json deleted file mode 100644 index 97a0e72a095..00000000000 --- a/analyzers/its/expected/Net6/S1481-Net6-net6.0.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "Issues": [ - { - "Id": "S1481", - "Message": "Remove the unused local variable \u0027foo\u0027.", - "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/Net6/Net6/Program.cs#L2", - "Location": "Line 2 Position 5-8" - } - ] -} \ No newline at end of file diff --git a/analyzers/its/expected/Net6/S3353-Net6-net6.0.json b/analyzers/its/expected/Net6/S3353-Net6-net6.0.json deleted file mode 100644 index 21d9afea7d9..00000000000 --- a/analyzers/its/expected/Net6/S3353-Net6-net6.0.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "Issues": [ - { - "Id": "S3353", - "Message": "Add the \u0027const\u0027 modifier to \u0027foo\u0027, and replace \u0027var\u0027 with \u0027int\u0027.", - "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/Net6/Net6/Program.cs#L2", - "Location": "Line 2 Position 5-8" - } - ] -} \ No newline at end of file diff --git a/analyzers/its/expected/Net6/S3990-Net6-net6.0.json b/analyzers/its/expected/Net6/S3990-Net6-net6.0.json deleted file mode 100644 index 80855affac4..00000000000 --- a/analyzers/its/expected/Net6/S3990-Net6-net6.0.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "Issues": [ - { - "Id": "S3990", - "Message": "Provide a \u0027CLSCompliant\u0027 attribute for assembly \u0027Net6\u0027.", - "Uri": null, - "Location": null - } - ] -} \ No newline at end of file diff --git a/analyzers/its/expected/Net6/S3992-Net6-net6.0.json b/analyzers/its/expected/Net6/S3992-Net6-net6.0.json deleted file mode 100644 index a01296ce2d4..00000000000 --- a/analyzers/its/expected/Net6/S3992-Net6-net6.0.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "Issues": [ - { - "Id": "S3992", - "Message": "Provide a \u0027ComVisible\u0027 attribute for assembly \u0027Net6\u0027.", - "Uri": null, - "Location": null - } - ] -} \ No newline at end of file diff --git a/analyzers/its/expected/Net6/S4055-Net6-net6.0.json b/analyzers/its/expected/Net6/S4055-Net6-net6.0.json deleted file mode 100644 index 3a395eb8748..00000000000 --- a/analyzers/its/expected/Net6/S4055-Net6-net6.0.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "Issues": [ - { - "Id": "S4055", - "Message": "Replace this string literal with a string retrieved through an instance of the \u0027ResourceManager\u0027 class.", - "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/Net6/Net6/Program.cs#L3", - "Location": "Line 3 Position 19-34" - } - ] -} \ No newline at end of file diff --git a/analyzers/its/expected/Net7/S1451-Net7-net7.0.json b/analyzers/its/expected/Net7/S1451-Net7-net7.0.json deleted file mode 100644 index 3ccae3db6a9..00000000000 --- a/analyzers/its/expected/Net7/S1451-Net7-net7.0.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "Issues": [ - { - "Id": "S1451", - "Message": "Add or update the header of this file.", - "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/Net7/Net7/Program.cs#L1", - "Location": "Line 1 Position 1-1" - } - ] -} \ No newline at end of file diff --git a/analyzers/its/expected/Net7/S1481-Net7-net7.0.json b/analyzers/its/expected/Net7/S1481-Net7-net7.0.json deleted file mode 100644 index f395247b3ed..00000000000 --- a/analyzers/its/expected/Net7/S1481-Net7-net7.0.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "Issues": [ - { - "Id": "S1481", - "Message": "Remove the unused local variable \u0027foo\u0027.", - "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/Net7/Net7/Program.cs#L2", - "Location": "Line 2 Position 5-8" - } - ] -} \ No newline at end of file diff --git a/analyzers/its/expected/Net7/S3353-Net7-net7.0.json b/analyzers/its/expected/Net7/S3353-Net7-net7.0.json deleted file mode 100644 index 1352acdc78e..00000000000 --- a/analyzers/its/expected/Net7/S3353-Net7-net7.0.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "Issues": [ - { - "Id": "S3353", - "Message": "Add the \u0027const\u0027 modifier to \u0027foo\u0027, and replace \u0027var\u0027 with \u0027int\u0027.", - "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/Net7/Net7/Program.cs#L2", - "Location": "Line 2 Position 5-8" - } - ] -} \ No newline at end of file diff --git a/analyzers/its/expected/Net7/S3990-Net7-net7.0.json b/analyzers/its/expected/Net7/S3990-Net7-net7.0.json deleted file mode 100644 index 413b1d48fa1..00000000000 --- a/analyzers/its/expected/Net7/S3990-Net7-net7.0.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "Issues": [ - { - "Id": "S3990", - "Message": "Provide a \u0027CLSCompliant\u0027 attribute for assembly \u0027Net7\u0027.", - "Uri": null, - "Location": null - } - ] -} \ No newline at end of file diff --git a/analyzers/its/expected/Net7/S3992-Net7-net7.0.json b/analyzers/its/expected/Net7/S3992-Net7-net7.0.json deleted file mode 100644 index 533b786f3f4..00000000000 --- a/analyzers/its/expected/Net7/S3992-Net7-net7.0.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "Issues": [ - { - "Id": "S3992", - "Message": "Provide a \u0027ComVisible\u0027 attribute for assembly \u0027Net7\u0027.", - "Uri": null, - "Location": null - } - ] -} \ No newline at end of file diff --git a/analyzers/its/expected/Net7/S4055-Net7-net7.0.json b/analyzers/its/expected/Net7/S4055-Net7-net7.0.json deleted file mode 100644 index bb356e6fbed..00000000000 --- a/analyzers/its/expected/Net7/S4055-Net7-net7.0.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "Issues": [ - { - "Id": "S4055", - "Message": "Replace this string literal with a string retrieved through an instance of the \u0027ResourceManager\u0027 class.", - "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/Net7/Net7/Program.cs#L3", - "Location": "Line 3 Position 19-34" - } - ] -} \ No newline at end of file diff --git a/analyzers/its/expected/Net8/S1451-Net8-net8.0.json b/analyzers/its/expected/Net8/S1451-Net8-net8.0.json deleted file mode 100644 index d26909735ac..00000000000 --- a/analyzers/its/expected/Net8/S1451-Net8-net8.0.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "Issues": [ - { - "Id": "S1451", - "Message": "Add or update the header of this file.", - "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/Net8/Net8/Program.cs#L1", - "Location": "Line 1 Position 1-1" - } - ] -} \ No newline at end of file diff --git a/analyzers/its/expected/Net8/S1481-Net8-net8.0.json b/analyzers/its/expected/Net8/S1481-Net8-net8.0.json deleted file mode 100644 index 98b1a1b26ec..00000000000 --- a/analyzers/its/expected/Net8/S1481-Net8-net8.0.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "Issues": [ - { - "Id": "S1481", - "Message": "Remove the unused local variable \u0027foo\u0027.", - "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/Net8/Net8/Program.cs#L2", - "Location": "Line 2 Position 5-8" - } - ] -} \ No newline at end of file diff --git a/analyzers/its/expected/Net8/S3353-Net8-net8.0.json b/analyzers/its/expected/Net8/S3353-Net8-net8.0.json deleted file mode 100644 index fa3e56a3939..00000000000 --- a/analyzers/its/expected/Net8/S3353-Net8-net8.0.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "Issues": [ - { - "Id": "S3353", - "Message": "Add the \u0027const\u0027 modifier to \u0027foo\u0027, and replace \u0027var\u0027 with \u0027int\u0027.", - "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/Net8/Net8/Program.cs#L2", - "Location": "Line 2 Position 5-8" - } - ] -} \ No newline at end of file diff --git a/analyzers/its/expected/Net8/S3990-Net8-net8.0.json b/analyzers/its/expected/Net8/S3990-Net8-net8.0.json deleted file mode 100644 index 6618df78669..00000000000 --- a/analyzers/its/expected/Net8/S3990-Net8-net8.0.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "Issues": [ - { - "Id": "S3990", - "Message": "Provide a \u0027CLSCompliant\u0027 attribute for assembly \u0027Net8\u0027.", - "Uri": null, - "Location": null - } - ] -} \ No newline at end of file diff --git a/analyzers/its/expected/Net8/S3992-Net8-net8.0.json b/analyzers/its/expected/Net8/S3992-Net8-net8.0.json deleted file mode 100644 index 0b821632f99..00000000000 --- a/analyzers/its/expected/Net8/S3992-Net8-net8.0.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "Issues": [ - { - "Id": "S3992", - "Message": "Provide a \u0027ComVisible\u0027 attribute for assembly \u0027Net8\u0027.", - "Uri": null, - "Location": null - } - ] -} \ No newline at end of file diff --git a/analyzers/its/expected/Net8/S4055-Net8-net8.0.json b/analyzers/its/expected/Net8/S4055-Net8-net8.0.json deleted file mode 100644 index 94fb5b3eb43..00000000000 --- a/analyzers/its/expected/Net8/S4055-Net8-net8.0.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "Issues": [ - { - "Id": "S4055", - "Message": "Replace this string literal with a string retrieved through an instance of the \u0027ResourceManager\u0027 class.", - "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/Net8/Net8/Program.cs#L3", - "Location": "Line 3 Position 19-34" - } - ] -} \ No newline at end of file diff --git a/analyzers/its/expected/NetCore31/S105-NetCore31-netcoreapp3.1.json b/analyzers/its/expected/NetCore31/S105-NetCore31-netcoreapp3.1.json deleted file mode 100644 index 622a936bd09..00000000000 --- a/analyzers/its/expected/NetCore31/S105-NetCore31-netcoreapp3.1.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "Issues": [ - { - "Id": "S105", - "Message": "Replace all tab characters in this file by sequences of white-spaces.", - "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/NetCore31/NetCore31/Program.cs#L11", - "Location": "Line 11 Position 1-1" - } - ] -} \ No newline at end of file diff --git a/analyzers/its/expected/NetCore31/S106-NetCore31-netcoreapp3.1.json b/analyzers/its/expected/NetCore31/S106-NetCore31-netcoreapp3.1.json deleted file mode 100644 index 15e42804930..00000000000 --- a/analyzers/its/expected/NetCore31/S106-NetCore31-netcoreapp3.1.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "Issues": [ - { - "Id": "S106", - "Message": "Remove this logging statement.", - "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/NetCore31/NetCore31/Program.cs#L11", - "Location": "Line 11 Position 4-21" - } - ] -} \ No newline at end of file diff --git a/analyzers/its/expected/NetCore31/S1118-NetCore31-netcoreapp3.1.json b/analyzers/its/expected/NetCore31/S1118-NetCore31-netcoreapp3.1.json deleted file mode 100644 index 7d1d34d17e5..00000000000 --- a/analyzers/its/expected/NetCore31/S1118-NetCore31-netcoreapp3.1.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "Issues": [ - { - "Id": "S1118", - "Message": "Add a \u0027protected\u0027 constructor or the \u0027static\u0027 keyword to the class declaration.", - "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/NetCore31/NetCore31/Program.cs#L5", - "Location": "Line 5 Position 11-18" - } - ] -} \ No newline at end of file diff --git a/analyzers/its/expected/NetCore31/S1128-NetCore31-netcoreapp3.1.json b/analyzers/its/expected/NetCore31/S1128-NetCore31-netcoreapp3.1.json deleted file mode 100644 index 59d285b30c4..00000000000 --- a/analyzers/its/expected/NetCore31/S1128-NetCore31-netcoreapp3.1.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "Issues": [ - { - "Id": "S1128", - "Message": "Remove this unnecessary \u0027using\u0027.", - "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/NetCore31/NetCore31/obj/Debug/netcoreapp3.1/.NETCoreApp,Version=v3.1.AssemblyAttributes.cs#L3", - "Location": "Line 3 Position 1-25" - } - ] -} \ No newline at end of file diff --git a/analyzers/its/expected/NetCore31/S1451-NetCore31-netcoreapp3.1.json b/analyzers/its/expected/NetCore31/S1451-NetCore31-netcoreapp3.1.json deleted file mode 100644 index c023630923f..00000000000 --- a/analyzers/its/expected/NetCore31/S1451-NetCore31-netcoreapp3.1.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "Issues": [ - { - "Id": "S1451", - "Message": "Add or update the header of this file.", - "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/NetCore31/NetCore31/obj/Debug/netcoreapp3.1/.NETCoreApp,Version=v3.1.AssemblyAttributes.cs#L1", - "Location": "Line 1 Position 1-1" - }, - { - "Id": "S1451", - "Message": "Add or update the header of this file.", - "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/NetCore31/NetCore31/obj/Debug/netcoreapp3.1/NetCore31.AssemblyInfo.cs#L1", - "Location": "Line 1 Position 1-1" - }, - { - "Id": "S1451", - "Message": "Add or update the header of this file.", - "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/NetCore31/NetCore31/Program.cs#L1", - "Location": "Line 1 Position 1-1" - } - ] -} \ No newline at end of file diff --git a/analyzers/its/expected/NetCore31/S1481-NetCore31-netcoreapp3.1.json b/analyzers/its/expected/NetCore31/S1481-NetCore31-netcoreapp3.1.json deleted file mode 100644 index 571a41d8c93..00000000000 --- a/analyzers/its/expected/NetCore31/S1481-NetCore31-netcoreapp3.1.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "Issues": [ - { - "Id": "S1481", - "Message": "Remove the unused local variable \u0027foo\u0027.", - "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/NetCore31/NetCore31/Program.cs#L10", - "Location": "Line 10 Position 17-20" - } - ] -} \ No newline at end of file diff --git a/analyzers/its/expected/NetCore31/S3353-NetCore31-netcoreapp3.1.json b/analyzers/its/expected/NetCore31/S3353-NetCore31-netcoreapp3.1.json deleted file mode 100644 index 498979ef40d..00000000000 --- a/analyzers/its/expected/NetCore31/S3353-NetCore31-netcoreapp3.1.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "Issues": [ - { - "Id": "S3353", - "Message": "Add the \u0027const\u0027 modifier to \u0027foo\u0027, and replace \u0027var\u0027 with \u0027int\u0027.", - "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/NetCore31/NetCore31/Program.cs#L10", - "Location": "Line 10 Position 17-20" - } - ] -} \ No newline at end of file diff --git a/analyzers/its/expected/NetCore31/S3990-NetCore31-netcoreapp3.1.json b/analyzers/its/expected/NetCore31/S3990-NetCore31-netcoreapp3.1.json deleted file mode 100644 index c3e8fc45f26..00000000000 --- a/analyzers/its/expected/NetCore31/S3990-NetCore31-netcoreapp3.1.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "Issues": [ - { - "Id": "S3990", - "Message": "Provide a \u0027CLSCompliant\u0027 attribute for assembly \u0027NetCore31\u0027.", - "Uri": null, - "Location": null - } - ] -} \ No newline at end of file diff --git a/analyzers/its/expected/NetCore31/S3992-NetCore31-netcoreapp3.1.json b/analyzers/its/expected/NetCore31/S3992-NetCore31-netcoreapp3.1.json deleted file mode 100644 index 7d1ac97e44b..00000000000 --- a/analyzers/its/expected/NetCore31/S3992-NetCore31-netcoreapp3.1.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "Issues": [ - { - "Id": "S3992", - "Message": "Provide a \u0027ComVisible\u0027 attribute for assembly \u0027NetCore31\u0027.", - "Uri": null, - "Location": null - } - ] -} \ No newline at end of file diff --git a/analyzers/its/expected/NetCore31/S4055-NetCore31-netcoreapp3.1.json b/analyzers/its/expected/NetCore31/S4055-NetCore31-netcoreapp3.1.json deleted file mode 100644 index 4c31720faeb..00000000000 --- a/analyzers/its/expected/NetCore31/S4055-NetCore31-netcoreapp3.1.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "Issues": [ - { - "Id": "S4055", - "Message": "Replace this string literal with a string retrieved through an instance of the \u0027ResourceManager\u0027 class.", - "Uri": "https://github.com/SonarSource/sonar-dotnet/blob/master/analyzers/its/Projects/NetCore31/NetCore31/Program.cs#L11", - "Location": "Line 11 Position 22-36" - } - ] -} \ No newline at end of file diff --git a/analyzers/its/regression-test.ps1 b/analyzers/its/regression-test.ps1 index 88e458be246..320489f5b7f 100644 --- a/analyzers/its/regression-test.ps1 +++ b/analyzers/its/regression-test.ps1 @@ -7,7 +7,7 @@ param $ruleId, [Parameter(HelpMessage = "The name of single project to build. If ommited, all projects will be build.")] - [ValidateSet("AnalyzeGenerated.CS", "AnalyzeGenerated.VB", "akka.net", "AutoMapper", "BlazorSample", "CSharpLatest", "Ember-MM", "Nancy", "NetCore31", "Net6", "Net7", "Net8", "ManuallyAddedNoncompliantIssues.CS", "ManuallyAddedNoncompliantIssues.VB", "RazorSample", "Roslyn.1.3.1", "SkipGenerated.CS", "SkipGenerated.VB", "SonarLintExclusions", "WebConfig")] + [ValidateSet("AnalyzeGenerated.CS", "AnalyzeGenerated.VB", "akka.net", "AutoMapper", "BlazorSample", "CSharpLatest", "Ember-MM", "Nancy", "ManuallyAddedNoncompliantIssues.CS", "ManuallyAddedNoncompliantIssues.VB", "RazorSample", "Roslyn.1.3.1", "SkipGenerated.CS", "SkipGenerated.VB", "SonarLintExclusions", "WebConfig")] [string] $project ) @@ -261,10 +261,6 @@ try { Build-Project-MSBuild "SkipGenerated.VB" "SkipGenerated.VB.sln" Build-Project-MSBuild "WebConfig" "WebConfig.sln" - Build-Project-DotnetTool "NetCore31" "NetCore31.sln" - Build-Project-DotnetTool "Net6" "Net6.sln" - Build-Project-DotnetTool "Net7" "Net7.sln" - Build-Project-DotnetTool "Net8" "Net8.sln" Build-Project-DotnetTool "akka.net" "src\Akka.sln" Build-Project-DotnetTool "AutoMapper" "AutoMapper.sln" Build-Project-DotnetTool "SonarLintExclusions" "SonarLintExclusions.sln" diff --git a/analyzers/its/update-expected.ps1 b/analyzers/its/update-expected.ps1 index 8bf9c217cc4..54516932a84 100644 --- a/analyzers/its/update-expected.ps1 +++ b/analyzers/its/update-expected.ps1 @@ -2,7 +2,7 @@ param ( [Parameter(HelpMessage = "The name of single project to update issues for. If ommited, issues for all projects will be updated.")] - [ValidateSet("", "AnalyzeGenerated.CS", "AnalyzeGenerated.VB", "akka.net", "AutoMapper", "BlazorSample", "CSharpLatest", "Ember-MM", "Nancy", "NetCore31", "Net6", "Net7", "Net8", "ManuallyAddedNoncompliantIssues.CS", "ManuallyAddedNoncompliantIssues.VB", "RazorSample", "Roslyn.1.3.1", "SkipGenerated.CS", "SkipGenerated.VB", "SonarLintExclusions", "WebConfig")] + [ValidateSet("", "AnalyzeGenerated.CS", "AnalyzeGenerated.VB", "akka.net", "AutoMapper", "BlazorSample", "CSharpLatest", "Ember-MM", "Nancy", "ManuallyAddedNoncompliantIssues.CS", "ManuallyAddedNoncompliantIssues.VB", "RazorSample", "Roslyn.1.3.1", "SkipGenerated.CS", "SkipGenerated.VB", "SonarLintExclusions", "WebConfig")] [string] $project ) diff --git a/its/projects/Net5/Net5/Main.cs b/its/projects/Net5/Net5/Main.cs index 983d1ffb234..5d39d0a53c7 100644 --- a/its/projects/Net5/Net5/Main.cs +++ b/its/projects/Net5/Net5/Main.cs @@ -1,4 +1,13 @@ using System; -// FIXME this is expected to raise S1134 -Console.WriteLine("Hello World!"); +namespace Net5 +{ + static class Program + { + static void Main(string[] args) + { + // FIXME this is expected to raise S1134 + Console.WriteLine("Hello World!"); + } + } +} diff --git a/its/projects/Net6/Net6/Net6.csproj b/its/projects/Net6/Net6/Net6.csproj new file mode 100644 index 00000000000..41f1d5ad4b2 --- /dev/null +++ b/its/projects/Net6/Net6/Net6.csproj @@ -0,0 +1,8 @@ + + + + Exe + net6.0 + + + diff --git a/its/projects/Net6/Net6/Program.cs b/its/projects/Net6/Net6/Program.cs new file mode 100644 index 00000000000..b68fe9be7fb --- /dev/null +++ b/its/projects/Net6/Net6/Program.cs @@ -0,0 +1,13 @@ +using System; + +namespace Net6 +{ + static class Program + { + static void Main(string[] args) + { + // FIXME this is expected to raise S1134 + Console.WriteLine("Hello World!"); + } + } +} diff --git a/analyzers/its/Projects/Net6/global.json b/its/projects/Net6/global.json similarity index 100% rename from analyzers/its/Projects/Net6/global.json rename to its/projects/Net6/global.json diff --git a/analyzers/its/Projects/Net6/net6.sln b/its/projects/Net6/net6.sln similarity index 100% rename from analyzers/its/Projects/Net6/net6.sln rename to its/projects/Net6/net6.sln diff --git a/analyzers/its/Projects/Net7/Net7.sln b/its/projects/Net7/Net7.sln similarity index 100% rename from analyzers/its/Projects/Net7/Net7.sln rename to its/projects/Net7/Net7.sln diff --git a/analyzers/its/Projects/Net7/Net7/Net7.csproj b/its/projects/Net7/Net7/Net7.csproj similarity index 68% rename from analyzers/its/Projects/Net7/Net7/Net7.csproj rename to its/projects/Net7/Net7/Net7.csproj index f02677bf640..120e38c3150 100644 --- a/analyzers/its/Projects/Net7/Net7/Net7.csproj +++ b/its/projects/Net7/Net7/Net7.csproj @@ -3,8 +3,6 @@ Exe net7.0 - enable - enable diff --git a/its/projects/Net7/Net7/Program.cs b/its/projects/Net7/Net7/Program.cs new file mode 100644 index 00000000000..fde69265815 --- /dev/null +++ b/its/projects/Net7/Net7/Program.cs @@ -0,0 +1,13 @@ +using System; + +namespace Net7 +{ + static class Program + { + static void Main(string[] args) + { + // FIXME this is expected to raise S1134 + Console.WriteLine("Hello World!"); + } + } +} diff --git a/analyzers/its/Projects/Net7/global.json b/its/projects/Net7/global.json similarity index 100% rename from analyzers/its/Projects/Net7/global.json rename to its/projects/Net7/global.json diff --git a/analyzers/its/Projects/Net8/Net8.sln b/its/projects/Net8/Net8.sln similarity index 100% rename from analyzers/its/Projects/Net8/Net8.sln rename to its/projects/Net8/Net8.sln diff --git a/analyzers/its/Projects/Net8/Net8/Net8.csproj b/its/projects/Net8/Net8/Net8.csproj similarity index 68% rename from analyzers/its/Projects/Net8/Net8/Net8.csproj rename to its/projects/Net8/Net8/Net8.csproj index 2150e3797ba..21114b11099 100644 --- a/analyzers/its/Projects/Net8/Net8/Net8.csproj +++ b/its/projects/Net8/Net8/Net8.csproj @@ -3,8 +3,6 @@ Exe net8.0 - enable - enable diff --git a/its/projects/Net8/Net8/Program.cs b/its/projects/Net8/Net8/Program.cs new file mode 100644 index 00000000000..fde69265815 --- /dev/null +++ b/its/projects/Net8/Net8/Program.cs @@ -0,0 +1,13 @@ +using System; + +namespace Net7 +{ + static class Program + { + static void Main(string[] args) + { + // FIXME this is expected to raise S1134 + Console.WriteLine("Hello World!"); + } + } +} diff --git a/analyzers/its/Projects/Net8/global.json b/its/projects/Net8/global.json similarity index 100% rename from analyzers/its/Projects/Net8/global.json rename to its/projects/Net8/global.json diff --git a/analyzers/its/Projects/NetCore31/NetCore31.sln b/its/projects/NetCore31/NetCore31.sln similarity index 100% rename from analyzers/its/Projects/NetCore31/NetCore31.sln rename to its/projects/NetCore31/NetCore31.sln diff --git a/analyzers/its/Projects/NetCore31/NetCore31/NetCore31.csproj b/its/projects/NetCore31/NetCore31/NetCore31.csproj similarity index 99% rename from analyzers/its/Projects/NetCore31/NetCore31/NetCore31.csproj rename to its/projects/NetCore31/NetCore31/NetCore31.csproj index 7ad24434f1f..cb631906963 100644 --- a/analyzers/its/Projects/NetCore31/NetCore31/NetCore31.csproj +++ b/its/projects/NetCore31/NetCore31/NetCore31.csproj @@ -3,4 +3,5 @@ netcoreapp3.1 + diff --git a/its/projects/NetCore31/NetCore31/Program.cs b/its/projects/NetCore31/NetCore31/Program.cs new file mode 100644 index 00000000000..b9e3422053f --- /dev/null +++ b/its/projects/NetCore31/NetCore31/Program.cs @@ -0,0 +1,13 @@ +using System; + +namespace NetCore31 +{ + static class Program + { + static void Main(string[] args) + { + // FIXME this is expected to raise S1134 + Console.WriteLine("Hello World!"); + } + } +} diff --git a/analyzers/its/Projects/NetCore31/global.json b/its/projects/NetCore31/global.json similarity index 100% rename from analyzers/its/Projects/NetCore31/global.json rename to its/projects/NetCore31/global.json diff --git a/its/src/test/java/com/sonar/it/csharp/SdkTest.java b/its/src/test/java/com/sonar/it/csharp/SdkTest.java index 895518149a9..52407559249 100644 --- a/its/src/test/java/com/sonar/it/csharp/SdkTest.java +++ b/its/src/test/java/com/sonar/it/csharp/SdkTest.java @@ -39,16 +39,36 @@ public class SdkTest { @TempDir private static Path temp; + @Test + void netCore31() throws IOException { + validateProject("NetCore31"); + } + @Test void net5() throws IOException { validateProject("Net5"); } + @Test + void net6() throws IOException { + validateProject("Net6"); + } + + @Test + void net7() throws IOException { + validateProject("Net7"); + } + + @Test + void net8() throws IOException { + validateProject("Net8"); + } + void validateProject(String project) throws IOException { Tests.analyzeProject(temp, project); assertThat(getComponent(project)).isNotNull(); - assertThat(getIssues(project)).extracting(Issues.Issue::getLine, Issues.Issue::getRule).containsOnly(tuple(3, "csharpsquid:S1134")); assertThat(getMeasureAsInt(project, "files")).isEqualTo(1); - assertThat(getMeasureAsInt(project, "lines")).isEqualTo(5); + assertThat(getMeasureAsInt(project, "lines")).isEqualTo(14); + assertThat(getIssues(project)).extracting(Issues.Issue::getLine, Issues.Issue::getRule).containsOnly(tuple(9, "csharpsquid:S1134")); } }