diff --git a/src/CTA.FeatureDetection.Common/packages.lock.json b/src/CTA.FeatureDetection.Common/packages.lock.json index 2ce52059..d05c9bf9 100644 --- a/src/CTA.FeatureDetection.Common/packages.lock.json +++ b/src/CTA.FeatureDetection.Common/packages.lock.json @@ -54,12 +54,12 @@ }, "Codelyzer.Analysis": { "type": "Transitive", - "resolved": "2.4.67-alpha-g1343e12a71", - "contentHash": "B3Tnur23cEulOO1N85VLHqXXjGtj5KyRzPYpDUQb11JDKK/VfldFXGpXhLqTiLIT1D9s82JpBFku6YEWnfVhcQ==", + "resolved": "2.4.71-alpha-g6b1f22778c", + "contentHash": "iynKNXyC15wF0u9ZUTr4cKAmdYa1470AaGtvACuULL2BRK3VMHpzE01a/UvKbulKSXq0cZYaEMX+GrOlMVJuDQ==", "dependencies": { - "Codelyzer.Analysis.Build": "2.4.67-alpha-g1343e12a71", - "Codelyzer.Analysis.CSharp": "2.4.67-alpha-g1343e12a71", - "Codelyzer.Analysis.VisualBasic": "2.4.67-alpha-g1343e12a71", + "Codelyzer.Analysis.Build": "2.4.71-alpha-g6b1f22778c", + "Codelyzer.Analysis.CSharp": "2.4.71-alpha-g6b1f22778c", + "Codelyzer.Analysis.VisualBasic": "2.4.71-alpha-g6b1f22778c", "CommandLineParser": "2.8.0", "Microsoft.Build.Utilities.Core": "17.1.0", "Microsoft.Extensions.Logging.Console": "6.0.0", @@ -69,23 +69,23 @@ }, "Codelyzer.Analysis.Build": { "type": "Transitive", - "resolved": "2.4.67-alpha-g1343e12a71", - "contentHash": "fY2OFgAOuqn36mzWsVkzgdfKN2k2MP9+DFb6RRQx8VBbAuhuIr59pFbIiuVmY5hrCLMM+RkyMZcYsOZjBrn8bg==", + "resolved": "2.4.71-alpha-g6b1f22778c", + "contentHash": "+senXLbp84O5oiiT1hp/B+AzCDSo7/+C+1KkDQlNrMBANBseSpcoXVacYigGTGHbSK79V16ahIlvAjpE9e9RBA==", "dependencies": { "Buildalyzer": "4.1.4", "Buildalyzer.Logger": "4.1.4", "Buildalyzer.Workspaces": "4.1.4", - "Codelyzer.Analysis.Common": "2.4.67-alpha-g1343e12a71", + "Codelyzer.Analysis.Common": "2.4.71-alpha-g6b1f22778c", "Microsoft.Extensions.Logging": "6.0.0", "NuGet.Packaging": "6.0.0" } }, "Codelyzer.Analysis.Common": { "type": "Transitive", - "resolved": "2.4.67-alpha-g1343e12a71", - "contentHash": "MfoRWrPY8cxrBWbS5dvlEZIcyrdmhj3zom5cW9qlUsZDEfwOgE50+ki0g9b3lUL1eu5AwN36Jeqnf38B0OKcIw==", + "resolved": "2.4.71-alpha-g6b1f22778c", + "contentHash": "4nEVXfTc/FFzxkEulKOSd2s/2uh4bcTVbCncPCp4BZpf5qKLLXeLwf4VBzS/PFo6T5Y2D3A1F9kRlub74dLSXQ==", "dependencies": { - "Codelyzer.Analysis.Model": "2.4.67-alpha-g1343e12a71", + "Codelyzer.Analysis.Model": "2.4.71-alpha-g6b1f22778c", "Microsoft.Build": "17.0.0", "Microsoft.VisualStudio.Setup.Configuration.Interop": "3.1.2196", "Newtonsoft.Json": "13.0.1" @@ -93,17 +93,17 @@ }, "Codelyzer.Analysis.CSharp": { "type": "Transitive", - "resolved": "2.4.67-alpha-g1343e12a71", - "contentHash": "aREsAiwmuWFF9lZzCwcvJlgcKwGkxSE4l9yt/RCAN/4Nairby7hF4w1XG1smWSlznPi7d8ufuylMYfB734/flQ==", + "resolved": "2.4.71-alpha-g6b1f22778c", + "contentHash": "Q5Fs/FoDo6tz14aWEMCENHEjgTKJojE2/Wd1jSbFmjV8a8q27q6sk2gqMT5FcTO86THzt+GFeKq8b7FF8w2MoQ==", "dependencies": { - "Codelyzer.Analysis.Common": "2.4.67-alpha-g1343e12a71", - "Codelyzer.Analysis.Model": "2.4.67-alpha-g1343e12a71" + "Codelyzer.Analysis.Common": "2.4.71-alpha-g6b1f22778c", + "Codelyzer.Analysis.Model": "2.4.71-alpha-g6b1f22778c" } }, "Codelyzer.Analysis.Model": { "type": "Transitive", - "resolved": "2.4.67-alpha-g1343e12a71", - "contentHash": "ZGjzoOEUDjlnThorQ7ZxZXR2lQbKmM98qW9Hn193e5cLHmE91PXE8xNNMSEc/vTuj1+VggLKbdaeJelSZkaiqA==", + "resolved": "2.4.71-alpha-g6b1f22778c", + "contentHash": "Ma1ACdIXjWStzw7ImhowEsI4E9p2fNhiANgP8FU0uegQSZOaA4x/IaUU0Aij5s5mCTbNVPX6Z5j89g2+L9YftA==", "dependencies": { "Microsoft.CodeAnalysis": "4.1.0", "Microsoft.CodeAnalysis.CSharp": "4.1.0", @@ -114,11 +114,11 @@ }, "Codelyzer.Analysis.VisualBasic": { "type": "Transitive", - "resolved": "2.4.67-alpha-g1343e12a71", - "contentHash": "LJxM0bMPw/ONxC2N+v3kV4bHpTmtPt2Tr/aCP8jM2FjAXnSWNMyI+9pWuF1bKXNY9s+G7fGOjADwthX0D55Zsw==", + "resolved": "2.4.71-alpha-g6b1f22778c", + "contentHash": "Hxpzw8CXD+oKN47DnYqgoajIucyAIrEW8YOdwcJgT+RGyJ9biLentcSws/9yzVgoIQWV042ppIKp7PlgwRGrJA==", "dependencies": { - "Codelyzer.Analysis.Common": "2.4.67-alpha-g1343e12a71", - "Codelyzer.Analysis.Model": "2.4.67-alpha-g1343e12a71" + "Codelyzer.Analysis.Common": "2.4.71-alpha-g6b1f22778c", + "Codelyzer.Analysis.Model": "2.4.71-alpha-g6b1f22778c" } }, "CommandLineParser": { @@ -1711,8 +1711,8 @@ "cta.rules.config": { "type": "Project", "dependencies": { - "Codelyzer.Analysis": "2.4.67-alpha-g1343e12a71", - "Codelyzer.Analysis.Model": "2.4.67-alpha-g1343e12a71", + "Codelyzer.Analysis": "2.4.71-alpha-g6b1f22778c", + "Codelyzer.Analysis.Model": "2.4.71-alpha-g6b1f22778c", "Microsoft.Extensions.Logging": "6.0.0", "Microsoft.Extensions.Logging.Abstractions": "6.0.0", "Microsoft.Extensions.Logging.Console": "6.0.0", diff --git a/src/CTA.Rules.Analysis/VisualBasicRulesAnalysis.cs b/src/CTA.Rules.Analysis/VisualBasicRulesAnalysis.cs index 315a89a5..bd54e0cd 100644 --- a/src/CTA.Rules.Analysis/VisualBasicRulesAnalysis.cs +++ b/src/CTA.Rules.Analysis/VisualBasicRulesAnalysis.cs @@ -782,9 +782,10 @@ private void AddNamedActions(FileActions fileAction, VisualBasicNodeToken token, AccessorBlockActionFunc = c.AccessorBlockActionFunc })); - if (fileAction.VbTypeBlockActions.Any() || fileAction.VbMethodBlockActions.Any() - || fileAction.VbInterfaceBlockActions.Any() || - fileAction.VbAccessorBlockActions.Any()) + if (fileAction.VbTypeBlockActions.Any() || + fileAction.VbMethodBlockActions.Any() || + fileAction.VbInterfaceBlockActions.Any() || + fileAction.VbAccessorBlockActions.Any()) { var nodeToken = token.Clone(); nodeToken.TextSpan = textSpan; diff --git a/src/CTA.Rules.Config/CTA.Rules.Config.csproj b/src/CTA.Rules.Config/CTA.Rules.Config.csproj index e0c7992f..a1e0bb35 100644 --- a/src/CTA.Rules.Config/CTA.Rules.Config.csproj +++ b/src/CTA.Rules.Config/CTA.Rules.Config.csproj @@ -5,8 +5,8 @@ - - + + diff --git a/src/CTA.Rules.Models/packages.lock.json b/src/CTA.Rules.Models/packages.lock.json index f470400b..ac41963b 100644 --- a/src/CTA.Rules.Models/packages.lock.json +++ b/src/CTA.Rules.Models/packages.lock.json @@ -60,12 +60,12 @@ }, "Codelyzer.Analysis": { "type": "Transitive", - "resolved": "2.4.67-alpha-g1343e12a71", - "contentHash": "B3Tnur23cEulOO1N85VLHqXXjGtj5KyRzPYpDUQb11JDKK/VfldFXGpXhLqTiLIT1D9s82JpBFku6YEWnfVhcQ==", + "resolved": "2.4.71-alpha-g6b1f22778c", + "contentHash": "iynKNXyC15wF0u9ZUTr4cKAmdYa1470AaGtvACuULL2BRK3VMHpzE01a/UvKbulKSXq0cZYaEMX+GrOlMVJuDQ==", "dependencies": { - "Codelyzer.Analysis.Build": "2.4.67-alpha-g1343e12a71", - "Codelyzer.Analysis.CSharp": "2.4.67-alpha-g1343e12a71", - "Codelyzer.Analysis.VisualBasic": "2.4.67-alpha-g1343e12a71", + "Codelyzer.Analysis.Build": "2.4.71-alpha-g6b1f22778c", + "Codelyzer.Analysis.CSharp": "2.4.71-alpha-g6b1f22778c", + "Codelyzer.Analysis.VisualBasic": "2.4.71-alpha-g6b1f22778c", "CommandLineParser": "2.8.0", "Microsoft.Build.Utilities.Core": "17.1.0", "Microsoft.Extensions.Logging.Console": "6.0.0", @@ -75,23 +75,23 @@ }, "Codelyzer.Analysis.Build": { "type": "Transitive", - "resolved": "2.4.67-alpha-g1343e12a71", - "contentHash": "fY2OFgAOuqn36mzWsVkzgdfKN2k2MP9+DFb6RRQx8VBbAuhuIr59pFbIiuVmY5hrCLMM+RkyMZcYsOZjBrn8bg==", + "resolved": "2.4.71-alpha-g6b1f22778c", + "contentHash": "+senXLbp84O5oiiT1hp/B+AzCDSo7/+C+1KkDQlNrMBANBseSpcoXVacYigGTGHbSK79V16ahIlvAjpE9e9RBA==", "dependencies": { "Buildalyzer": "4.1.4", "Buildalyzer.Logger": "4.1.4", "Buildalyzer.Workspaces": "4.1.4", - "Codelyzer.Analysis.Common": "2.4.67-alpha-g1343e12a71", + "Codelyzer.Analysis.Common": "2.4.71-alpha-g6b1f22778c", "Microsoft.Extensions.Logging": "6.0.0", "NuGet.Packaging": "6.0.0" } }, "Codelyzer.Analysis.Common": { "type": "Transitive", - "resolved": "2.4.67-alpha-g1343e12a71", - "contentHash": "MfoRWrPY8cxrBWbS5dvlEZIcyrdmhj3zom5cW9qlUsZDEfwOgE50+ki0g9b3lUL1eu5AwN36Jeqnf38B0OKcIw==", + "resolved": "2.4.71-alpha-g6b1f22778c", + "contentHash": "4nEVXfTc/FFzxkEulKOSd2s/2uh4bcTVbCncPCp4BZpf5qKLLXeLwf4VBzS/PFo6T5Y2D3A1F9kRlub74dLSXQ==", "dependencies": { - "Codelyzer.Analysis.Model": "2.4.67-alpha-g1343e12a71", + "Codelyzer.Analysis.Model": "2.4.71-alpha-g6b1f22778c", "Microsoft.Build": "17.0.0", "Microsoft.VisualStudio.Setup.Configuration.Interop": "3.1.2196", "Newtonsoft.Json": "13.0.1" @@ -99,17 +99,17 @@ }, "Codelyzer.Analysis.CSharp": { "type": "Transitive", - "resolved": "2.4.67-alpha-g1343e12a71", - "contentHash": "aREsAiwmuWFF9lZzCwcvJlgcKwGkxSE4l9yt/RCAN/4Nairby7hF4w1XG1smWSlznPi7d8ufuylMYfB734/flQ==", + "resolved": "2.4.71-alpha-g6b1f22778c", + "contentHash": "Q5Fs/FoDo6tz14aWEMCENHEjgTKJojE2/Wd1jSbFmjV8a8q27q6sk2gqMT5FcTO86THzt+GFeKq8b7FF8w2MoQ==", "dependencies": { - "Codelyzer.Analysis.Common": "2.4.67-alpha-g1343e12a71", - "Codelyzer.Analysis.Model": "2.4.67-alpha-g1343e12a71" + "Codelyzer.Analysis.Common": "2.4.71-alpha-g6b1f22778c", + "Codelyzer.Analysis.Model": "2.4.71-alpha-g6b1f22778c" } }, "Codelyzer.Analysis.Model": { "type": "Transitive", - "resolved": "2.4.67-alpha-g1343e12a71", - "contentHash": "ZGjzoOEUDjlnThorQ7ZxZXR2lQbKmM98qW9Hn193e5cLHmE91PXE8xNNMSEc/vTuj1+VggLKbdaeJelSZkaiqA==", + "resolved": "2.4.71-alpha-g6b1f22778c", + "contentHash": "Ma1ACdIXjWStzw7ImhowEsI4E9p2fNhiANgP8FU0uegQSZOaA4x/IaUU0Aij5s5mCTbNVPX6Z5j89g2+L9YftA==", "dependencies": { "Microsoft.CodeAnalysis": "4.1.0", "Microsoft.CodeAnalysis.CSharp": "4.1.0", @@ -120,11 +120,11 @@ }, "Codelyzer.Analysis.VisualBasic": { "type": "Transitive", - "resolved": "2.4.67-alpha-g1343e12a71", - "contentHash": "LJxM0bMPw/ONxC2N+v3kV4bHpTmtPt2Tr/aCP8jM2FjAXnSWNMyI+9pWuF1bKXNY9s+G7fGOjADwthX0D55Zsw==", + "resolved": "2.4.71-alpha-g6b1f22778c", + "contentHash": "Hxpzw8CXD+oKN47DnYqgoajIucyAIrEW8YOdwcJgT+RGyJ9biLentcSws/9yzVgoIQWV042ppIKp7PlgwRGrJA==", "dependencies": { - "Codelyzer.Analysis.Common": "2.4.67-alpha-g1343e12a71", - "Codelyzer.Analysis.Model": "2.4.67-alpha-g1343e12a71" + "Codelyzer.Analysis.Common": "2.4.71-alpha-g6b1f22778c", + "Codelyzer.Analysis.Model": "2.4.71-alpha-g6b1f22778c" } }, "CommandLineParser": { @@ -1717,8 +1717,8 @@ "cta.rules.config": { "type": "Project", "dependencies": { - "Codelyzer.Analysis": "2.4.67-alpha-g1343e12a71", - "Codelyzer.Analysis.Model": "2.4.67-alpha-g1343e12a71", + "Codelyzer.Analysis": "2.4.71-alpha-g6b1f22778c", + "Codelyzer.Analysis.Model": "2.4.71-alpha-g6b1f22778c", "Microsoft.Extensions.Logging": "6.0.0", "Microsoft.Extensions.Logging.Abstractions": "6.0.0", "Microsoft.Extensions.Logging.Console": "6.0.0", diff --git a/tst/CTA.Rules.Test/VisualBasicTests.cs b/tst/CTA.Rules.Test/VisualBasicTests.cs index 7fc10fc5..78d318ed 100644 --- a/tst/CTA.Rules.Test/VisualBasicTests.cs +++ b/tst/CTA.Rules.Test/VisualBasicTests.cs @@ -97,6 +97,7 @@ public void TestOwinParadiseVb() var signalR = File.ReadAllText(Path.Combine(projresults.ProjectDirectory, "SignalR.vb")); var startUp = File.ReadAllText(Path.Combine(projresults.ProjectDirectory, "Startup.vb")); + var projectFile = File.ReadAllText(projresults.CsProjectPath); //Check that namespace has been added StringAssert.Contains(@"Microsoft.AspNetCore.Owin", startUp); @@ -112,6 +113,10 @@ public void TestOwinParadiseVb() //Check method actions StringAssert.Contains("UseEndpoints", signalR); + + //Check project porting + StringAssert.Contains("net5.0", projectFile); + StringAssert.Contains("Microsoft.AspNetCore.Diagnostics", projectFile); } [Test] @@ -129,5 +134,13 @@ public void TestVbNetMvc() // "v4.7.2", // results.CsProjectContent); } + + [Test] + public void TestMixedClassLibrary() + { + var slnResults = runCTAFile("MixedClassLibrary.sln"); + var projresults = slnResults.ProjectResults.FirstOrDefault(); + Assert.IsTrue(projresults != null); + } } }