Добавьте файлы проекта.
This commit is contained in:
58
SQLLinter.CLI/Program.cs
Normal file
58
SQLLinter.CLI/Program.cs
Normal file
@@ -0,0 +1,58 @@
|
||||
using SQLLinter.Infrastructure.Configuration;
|
||||
using SQLLinter.Infrastructure.Reporters;
|
||||
|
||||
namespace SQLLinter.CLI
|
||||
{
|
||||
internal class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
var rep = new MarkdownFileReporter();
|
||||
var con = new Config()
|
||||
{
|
||||
CompatibilityLevel = 170,
|
||||
Plugins = [],
|
||||
Rules = new()
|
||||
{
|
||||
["CaseSensitiveVariables"] = Common.RuleViolationSeverity.Critical,
|
||||
["ConditionalBeginEnd"] = Common.RuleViolationSeverity.Critical,
|
||||
["CountStar"] = Common.RuleViolationSeverity.Critical,
|
||||
["CrossDatabaseTransaction"] = Common.RuleViolationSeverity.Critical,
|
||||
["DataCompression"] = Common.RuleViolationSeverity.Critical,
|
||||
["DataTypeLength"] = Common.RuleViolationSeverity.Critical,
|
||||
["DeleteWhere"] = Common.RuleViolationSeverity.Critical,
|
||||
["DisallowCursors"] = Common.RuleViolationSeverity.Critical,
|
||||
["DuplicateEmptyLine"] = Common.RuleViolationSeverity.Off,
|
||||
["DuplicateGo"] = Common.RuleViolationSeverity.Critical,
|
||||
["FullText"] = Common.RuleViolationSeverity.Critical,
|
||||
["InformationSchema"] = Common.RuleViolationSeverity.Critical,
|
||||
["KeywordCapitalization"] = Common.RuleViolationSeverity.Critical,
|
||||
["LinkedServer"] = Common.RuleViolationSeverity.Critical,
|
||||
["MultiTableAlias"] = Common.RuleViolationSeverity.Critical,
|
||||
["NamedConstraint"] = Common.RuleViolationSeverity.Critical,
|
||||
["NonSargable"] = Common.RuleViolationSeverity.Critical,
|
||||
["ObjectProperty"] = Common.RuleViolationSeverity.Critical,
|
||||
["PrintStatement"] = Common.RuleViolationSeverity.Critical,
|
||||
["SchemaQualify"] = Common.RuleViolationSeverity.Critical,
|
||||
["SelectStar"] = Common.RuleViolationSeverity.Critical,
|
||||
["SemicolonTermination"] = Common.RuleViolationSeverity.Off,
|
||||
["UnicodeString"] = Common.RuleViolationSeverity.Critical,
|
||||
["UpdateWhere"] = Common.RuleViolationSeverity.Critical,
|
||||
["UpperLower"] = Common.RuleViolationSeverity.Critical,
|
||||
["SetVariable"] = Common.RuleViolationSeverity.Critical,
|
||||
}
|
||||
};
|
||||
|
||||
var linter = new Linter(con, rep);
|
||||
|
||||
using (StreamReader reader = new StreamReader(@"C:\Users\frost\Desktop\DISTR-2599\test.sql"))
|
||||
{
|
||||
linter.Run("test.sql", reader.BaseStream);
|
||||
}
|
||||
|
||||
//linter.Run(@"C:\Users\frost\Desktop\DISTR-2599\test.sql");
|
||||
|
||||
rep.SaveReport(@"C:\Users\frost\Desktop\DISTR-2599\test.md");
|
||||
}
|
||||
}
|
||||
}
|
||||
29
SQLLinter.CLI/SQLLinter.CLI.csproj
Normal file
29
SQLLinter.CLI/SQLLinter.CLI.csproj
Normal file
@@ -0,0 +1,29 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
<Version>1.0.0</Version>
|
||||
<Authors>FrigaT</Authors>
|
||||
<Company>FrigaT</Company>
|
||||
<Product>SQLLinter.CLI</Product>
|
||||
<Description>cli клиент для проверки MS SQL кода</Description>
|
||||
<Copyright>Copyright © 2025 FrigaT</Copyright>
|
||||
<RepositoryUrl>https://git.frigat.duckdns.org/FrigaT/SQLLint</RepositoryUrl>
|
||||
<RepositoryType>git</RepositoryType>
|
||||
<PackageProjectUrl>https://git.frigat.duckdns.org/FrigaT/SQLLint</PackageProjectUrl>
|
||||
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="ArgumentsToolkit" Version="0.0.3" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\SQLLinter\SQLLinter.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
Reference in New Issue
Block a user