Skip to content

Commit 893830b

Browse files
committed
Use code in Atc.*
1 parent ebb7b3d commit 893830b

28 files changed

+151
-216
lines changed

src/Atc.CodingRules.Updater.CLI/Commands/AnalyzerProvidersCacheCleanupCommand.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ public override int Execute(CommandContext context)
1717
}
1818
catch (Exception ex)
1919
{
20-
logger.LogError($"{EmojisConstants.Error} {ex.GetMessage()}");
20+
logger.LogError($"{Console.Spectre.EmojisConstants.Error} {ex.GetMessage()}");
2121
return ConsoleExitStatusCodes.Failure;
2222
}
2323

24-
logger.LogInformation($"{EmojisConstants.Done} Done");
24+
logger.LogInformation($"{Console.Spectre.EmojisConstants.Done} Done");
2525
return ConsoleExitStatusCodes.Success;
2626
}
2727
}

src/Atc.CodingRules.Updater.CLI/Commands/AnalyzerProvidersCollectCommand.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ await AnalyzerProviderBaseRulesHelper.GetAnalyzerProviderBaseRules(
3333
}
3434
catch (Exception ex)
3535
{
36-
logger.LogError($"{EmojisConstants.Error} {ex.GetMessage()}");
36+
logger.LogError($"{Console.Spectre.EmojisConstants.Error} {ex.GetMessage()}");
3737
return ConsoleExitStatusCodes.Failure;
3838
}
3939

40-
logger.LogInformation($"{EmojisConstants.Done} Done");
40+
logger.LogInformation($"{Console.Spectre.EmojisConstants.Done} Done");
4141
return ConsoleExitStatusCodes.Success;
4242
}
4343

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
namespace Atc.CodingRules.Updater.CLI.Commands;
2+
3+
internal static class ArgumentCommandConstants
4+
{
5+
public const string ShortProjectPath = "-p";
6+
public const string LongProjectPath = "--projectPath";
7+
public const string ShortOptionsPath = "-o";
8+
public const string LongOptionsTarget = "--optionsPath";
9+
public const string ShortProjectTarget = "-t";
10+
public const string LongProjectTarget = "--projectTarget";
11+
public const string LongUseLatestMinorNugetVersion = "--useLatestMinorNugetVersion";
12+
public const string ShortUseTemporarySuppressions = "-s";
13+
public const string LongUseTemporarySuppressions = "--useTemporarySuppressions";
14+
public const string LongTemporarySuppressionPath = "--temporarySuppressionPath";
15+
public const string LongTemporarySuppressionAsExcel = "--temporarySuppressionAsExcel";
16+
public const string LongBuildFile = "--buildFile";
17+
public const string LongFetchMode = "--fetchMode";
18+
public const string LongOrganizationName = " --organizationName";
19+
public const string LongRepositoryName = " --repositoryName";
20+
}

src/Atc.CodingRules.Updater.CLI/Commands/CommandConstants.cs

Lines changed: 0 additions & 37 deletions
This file was deleted.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
namespace Atc.CodingRules.Updater.CLI.Commands;
2+
3+
internal static class NameCommandConstants
4+
{
5+
public const string SanityCheck = "sanity-check";
6+
7+
public const string OptionsFile = "options-file";
8+
public const string OptionsFileCreate = "create";
9+
public const string OptionsFileValidate = "validate";
10+
11+
public const string AnalyzerProviders = "analyzer-providers";
12+
public const string AnalyzerProvidersCollect = "collect";
13+
public const string AnalyzerProvidersCleanupCache = "cleanup-cache";
14+
15+
public const string Run = "run";
16+
}

src/Atc.CodingRules.Updater.CLI/Commands/OptionsFileCreateCommand.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ private async Task<int> ExecuteInternalAsync(
3535
}
3636
catch (Exception ex)
3737
{
38-
logger.LogError($"{EmojisConstants.Error} {ex.GetMessage()}");
38+
logger.LogError($"{Console.Spectre.EmojisConstants.Error} {ex.GetMessage()}");
3939
return ConsoleExitStatusCodes.Failure;
4040
}
4141

42-
logger.LogInformation($"{EmojisConstants.Done} Done");
42+
logger.LogInformation($"{Console.Spectre.EmojisConstants.Done} Done");
4343
return ConsoleExitStatusCodes.Success;
4444
}
4545
}

src/Atc.CodingRules.Updater.CLI/Commands/OptionsFileValidateCommand.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ private async Task<int> ExecuteInternalAsync(
3838
}
3939
catch (Exception ex)
4040
{
41-
logger.LogError($"{EmojisConstants.Error} {ex.GetMessage()}");
41+
logger.LogError($"{Console.Spectre.EmojisConstants.Error} {ex.GetMessage()}");
4242
return ConsoleExitStatusCodes.Failure;
4343
}
4444

45-
logger.LogInformation($"{EmojisConstants.Done} Done");
45+
logger.LogInformation($"{Console.Spectre.EmojisConstants.Done} Done");
4646
return ConsoleExitStatusCodes.Success;
4747
}
4848
}

src/Atc.CodingRules.Updater.CLI/Commands/RootCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ private static async Task<int> ExecuteInternalAsync(
2626
[SuppressMessage("Globalization", "CA1303:Do not pass literals as localized parameters", Justification = "OK.")]
2727
private static void HandleVersionOption()
2828
{
29-
System.Console.WriteLine(CodingRulesUpdaterVersionHelper.GetCurrentVersion().ToString());
29+
System.Console.WriteLine(CliHelper.GetCurrentVersion().ToString());
3030
if (CodingRulesUpdaterVersionHelper.IsLatestVersion())
3131
{
3232
return;

src/Atc.CodingRules.Updater.CLI/Commands/RunCommand.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
using Spectre.Console;
2-
31
// ReSharper disable SuggestBaseTypeForParameter
42
namespace Atc.CodingRules.Updater.CLI.Commands;
53

@@ -55,11 +53,11 @@ await ProjectHelper.HandleFiles(
5553
}
5654
catch (Exception ex)
5755
{
58-
logger.LogError($"{EmojisConstants.Error} {ex.Message}");
56+
logger.LogError($"{Console.Spectre.EmojisConstants.Error} {ex.Message}");
5957
return ConsoleExitStatusCodes.Failure;
6058
}
6159

62-
logger.LogInformation($"{EmojisConstants.Done} Done");
60+
logger.LogInformation($"{Console.Spectre.EmojisConstants.Done} Done");
6361
return ConsoleExitStatusCodes.Success;
6462
}
6563

src/Atc.CodingRules.Updater.CLI/Commands/SanityCheckCommand.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ private async Task<int> ExecuteInternalAsync(
2929
}
3030
catch (Exception ex)
3131
{
32-
logger.LogError($"{EmojisConstants.Error} {ex.Message}");
32+
logger.LogError($"{Console.Spectre.EmojisConstants.Error} {ex.Message}");
3333
return ConsoleExitStatusCodes.Failure;
3434
}
3535

36-
logger.LogInformation($"{EmojisConstants.Done} Done");
36+
logger.LogInformation($"{Console.Spectre.EmojisConstants.Done} Done");
3737
return ConsoleExitStatusCodes.Success;
3838
}
3939

0 commit comments

Comments
 (0)