From b6928367cd0b4cce0954299f98cd7bf9e4e5f462 Mon Sep 17 00:00:00 2001 From: Erik Ejlskov Jensen Date: Tue, 1 Oct 2024 08:18:12 +0200 Subject: [PATCH] Address review comments --- src/DacpacTool/BuildOptions.cs | 2 +- src/DacpacTool/Program.cs | 4 ++-- .../templates/sqlproj/sqlproj.csproj | 1 + test/DacpacTool.Tests/PackageAnalyzerTests.cs | 1 - test/TestProjectWithAnalyzers/TestProjectWithAnalyzers.csproj | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/DacpacTool/BuildOptions.cs b/src/DacpacTool/BuildOptions.cs index c6d67dec..cc3adc63 100644 --- a/src/DacpacTool/BuildOptions.cs +++ b/src/DacpacTool/BuildOptions.cs @@ -22,7 +22,7 @@ public class BuildOptions : BaseOptions public bool RunCodeAnalysis { get; set; } public string CodeAnalysisRules { get; set; } - public FileInfo[] CodeAnalysisAssembly { get; set; } + public FileInfo[] CodeAnalysisAssemblies { get; set; } public bool WarnAsError { get; set; } public string SuppressWarnings { get; set; } public FileInfo SuppressWarningsListFile { get; set; } diff --git a/src/DacpacTool/Program.cs b/src/DacpacTool/Program.cs index 5457df17..a182ff53 100644 --- a/src/DacpacTool/Program.cs +++ b/src/DacpacTool/Program.cs @@ -33,7 +33,7 @@ static async Task Main(string[] args) new Option(new string[] { "--runcodeanalysis", "-an" }, "Run static code analysis"), new Option(new string[] { "--codeanalysisrules", "-ar" }, "List of rules to suppress in format '-Microsoft.Rules.Data.SR0001;-Microsoft.Rules.Data.SR0008'"), - new Option(new string[] { "--codeanalysisassembly", "-aa" }, "Custom code analysis rule assembly to use"), + new Option(new string[] { "--codeanalysisassemblies", "-aa" }, "Custom code analysis rule assemblies to use"), new Option(new string[] { "--warnaserror" }, "Treat T-SQL Warnings As Errors"), new Option(new string[] { "--generatecreatescript", "-gcs" }, "Generate create script for package"), @@ -207,7 +207,7 @@ private static int BuildDacpac(BuildOptions options) { var analyzer = new PackageAnalyzer(new ActualConsole(), options.CodeAnalysisRules); - analyzer.Analyze(packageBuilder.Model, options.Output, options.CodeAnalysisAssembly ?? Array.Empty()); + analyzer.Analyze(packageBuilder.Model, options.Output, options.CodeAnalysisAssemblies ?? Array.Empty()); } return 0; diff --git a/src/MSBuild.Sdk.SqlProj.Templates/templates/sqlproj/sqlproj.csproj b/src/MSBuild.Sdk.SqlProj.Templates/templates/sqlproj/sqlproj.csproj index ff0ec342..dc21a380 100644 --- a/src/MSBuild.Sdk.SqlProj.Templates/templates/sqlproj/sqlproj.csproj +++ b/src/MSBuild.Sdk.SqlProj.Templates/templates/sqlproj/sqlproj.csproj @@ -8,6 +8,7 @@ + diff --git a/test/DacpacTool.Tests/PackageAnalyzerTests.cs b/test/DacpacTool.Tests/PackageAnalyzerTests.cs index 99c84a68..caffa77c 100644 --- a/test/DacpacTool.Tests/PackageAnalyzerTests.cs +++ b/test/DacpacTool.Tests/PackageAnalyzerTests.cs @@ -160,7 +160,6 @@ private FileInfo[] CollectAssemblyPaths() { var result = new List(); var path = Path.GetDirectoryName(Path.Combine(System.Reflection.Assembly.GetAssembly(typeof(PackageAnalyzerTests)).Location)); - result.Add(new FileInfo(Path.Combine(path, "SqlServer.Dac.dll"))); result.Add(new FileInfo(Path.Combine(path, "SqlServer.Rules.dll"))); result.Add(new FileInfo(Path.Combine(path, "TSQLSmellSCA.dll"))); diff --git a/test/TestProjectWithAnalyzers/TestProjectWithAnalyzers.csproj b/test/TestProjectWithAnalyzers/TestProjectWithAnalyzers.csproj index b90b018e..807e575f 100644 --- a/test/TestProjectWithAnalyzers/TestProjectWithAnalyzers.csproj +++ b/test/TestProjectWithAnalyzers/TestProjectWithAnalyzers.csproj @@ -9,7 +9,7 @@ - +