Skip to content

Commit 1936a4b

Browse files
Merge pull request #74 from atc-net/hotfix/pdbonly
Cleanup and set CLI-project with DebugType=pdbonly
2 parents 154bcd5 + c723f3a commit 1936a4b

17 files changed

+62
-49
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ OPTIONS:
147147
-h, --help Prints help information
148148
149149
COMMANDS:
150-
create Create default options file 'atc-coding-rules-updater.json' if it doesn't exist
150+
create Create default options file 'atc-coding-rules-updater.json' if it doesn´t exist
151151
validate Validate the options file 'atc-coding-rules-updater.json'
152152
```
153153

@@ -164,7 +164,7 @@ Running the command above produces the following output
164164
```powershell
165165
____ _ _ _
166166
| _ \ _ _ | | ___ ___ _ _ _ __ __| | __ _ | |_ ___ _ __
167-
| |_) | | | | | | | / _ \ / __| | | | | | '_ \ / _` | / _` | | __| / _ \ | '__|
167+
| |_) | | | | | | | / _ \ / __| | | | | | `_ \ / _` | / _` | | __| / _ \ | `__|
168168
| _ < | |_| | | | | __/ \__ \ | |_| | | |_) | | (_| | | (_| | | |_ | __/ | |
169169
|_| \_\ \__,_| |_| \___| |___/ \__,_| | .__/ \__,_| \__,_| \__| \___| |_|
170170
|_|

src/Atc.CodingRules.Updater.CLI/Atc.CodingRules.Updater.CLI.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<OutputType>Exe</OutputType>
1010
<AssemblyName>atc-coding-rules-updater</AssemblyName>
1111
<PackAsTool>true</PackAsTool>
12+
<DebugType>pdbonly</DebugType>
1213
</PropertyGroup>
1314

1415
<ItemGroup>

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
using Atc.CodingRules.Updater.CLI.Models.Options;
2+
13
namespace Atc.CodingRules.Updater.CLI.Commands;
24

35
public class AnalyzerProvidersCollectCommand : AsyncCommand<AnalyzerProvidersCollectCommandSettings>
@@ -41,7 +43,7 @@ await AnalyzerProviderBaseRulesHelper.GetAnalyzerProviderBaseRules(
4143
return ConsoleExitStatusCodes.Success;
4244
}
4345

44-
private static async Task<Options> GetOptionsFromFileAndUserArguments(
46+
private static async Task<OptionsFile> GetOptionsFromFileAndUserArguments(
4547
AnalyzerProvidersCollectCommandSettings settings,
4648
DirectoryInfo projectPath)
4749
{

src/Atc.CodingRules.Updater.CLI/Commands/DescriptionAttributes/SupportedProjectTargetTypeDescriptionAttribute.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System.ComponentModel;
2+
using Atc.CodingRules.Updater.CLI.Models.Options;
23

34
namespace Atc.CodingRules.Updater.CLI.Commands.DescriptionAttributes;
45

@@ -9,7 +10,7 @@ public override string Description
910
{
1011
get
1112
{
12-
var defaultValue = new Options().ProjectTarget;
13+
var defaultValue = new OptionsFile().ProjectTarget;
1314
var values = Enum.GetNames(typeof(SupportedProjectTargetType))
1415
.Select(enumValue => enumValue.Equals(defaultValue.ToString(), StringComparison.Ordinal)
1516
? $"{enumValue} (default)"

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@ internal static class NameCommandConstants
44
{
55
public const string SanityCheck = "sanity-check";
66

7-
public const string OptionsFile = "options-file";
8-
public const string OptionsFileCreate = "create";
9-
public const string OptionsFileValidate = "validate";
10-
117
public const string AnalyzerProviders = "analyzer-providers";
128
public const string AnalyzerProvidersCollect = "collect";
139
public const string AnalyzerProvidersCleanupCache = "cleanup-cache";

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ public override Task<int> ExecuteAsync(
1818
private async Task<int> ExecuteInternalAsync(
1919
ProjectBaseCommandSettings settings)
2020
{
21-
ArgumentNullException.ThrowIfNull(settings);
2221
ConsoleHelper.WriteHeader();
2322

2423
var projectPath = new DirectoryInfo(settings.ProjectPath);

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
// ReSharper disable SuggestBaseTypeForParameter
2+
3+
using Atc.CodingRules.Updater.CLI.Models.Options;
4+
25
namespace Atc.CodingRules.Updater.CLI.Commands;
36

47
public class RunCommand : AsyncCommand<RunCommandSettings>
@@ -61,7 +64,7 @@ await ProjectHelper.HandleFiles(
6164
return ConsoleExitStatusCodes.Success;
6265
}
6366

64-
private static async Task<Options> GetOptionsFromFileAndUserArguments(
67+
private static async Task<OptionsFile> GetOptionsFromFileAndUserArguments(
6568
RunCommandSettings settings,
6669
DirectoryInfo projectPath)
6770
{

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
using Atc.CodingRules.Updater.CLI.Models.Options;
2+
13
namespace Atc.CodingRules.Updater.CLI.Commands;
24

35
public class SanityCheckCommand : AsyncCommand<ProjectCommandSettings>
@@ -37,7 +39,7 @@ private async Task<int> ExecuteInternalAsync(
3739
return ConsoleExitStatusCodes.Success;
3840
}
3941

40-
private static async Task<Options> GetOptionsFromFileAndUserArguments(
42+
private static async Task<OptionsFile> GetOptionsFromFileAndUserArguments(
4143
ProjectCommandSettings settings,
4244
DirectoryInfo projectPath)
4345
{

src/Atc.CodingRules.Updater.CLI/Extensions/CommandAppExtensions.cs

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public static void ConfigureCommands(this CommandApp<RootCommand> app)
1212

1313
ConfigureSanityCheckCommand(config);
1414

15-
config.AddBranch(NameCommandConstants.OptionsFile, ConfigureOptionsFileCommands());
15+
config.AddBranch(CommandConstants.NameOptionsFile, ConfigureOptionsFileCommands());
1616

1717
config.AddBranch(NameCommandConstants.AnalyzerProviders, ConfigureAnalyzerProvidersCommands());
1818
});
@@ -57,14 +57,14 @@ private static Action<IConfigurator<CommandSettings>> ConfigureOptionsFileComman
5757
node.SetDescription("Commands for the options file 'atc-coding-rules-updater.json'");
5858

5959
node
60-
.AddCommand<OptionsFileCreateCommand>(NameCommandConstants.OptionsFileCreate)
60+
.AddCommand<OptionsFileCreateCommand>(CommandConstants.NameOptionsFileCreate)
6161
.WithDescription("Create default options file 'atc-coding-rules-updater.json' if it doesn't exist")
6262
.WithExample(new[] { CreateArgumentCommandsOptionsFileWithCreate(), ".", CreateEquivalentToOptionsFileCreate(6), })
6363
.WithExample(new[] { CreateArgumentCommandsOptionsFileWithCreate(), CreateArgumentProjectPathWithDot(), CreateEquivalentToOptionsFileCreate(3), })
6464
.WithExample(new[] { CreateArgumentCommandsOptionsFileWithCreate(), CreateArgumentProjectPathWithTestFolder(), });
6565

6666
node
67-
.AddCommand<OptionsFileValidateCommand>(NameCommandConstants.OptionsFileValidate)
67+
.AddCommand<OptionsFileValidateCommand>(CommandConstants.NameOptionsFileValidate)
6868
.WithDescription("Validate the options file 'atc-coding-rules-updater.json'")
6969
.WithExample(new[] { CreateArgumentCommandsOptionsFileWithValidate(), ".", CreateEquivalentToOptionsFileValidate(4), })
7070
.WithExample(new[] { CreateArgumentCommandsOptionsFileWithValidate(), CreateArgumentProjectPathWithTestFolder() });
@@ -96,23 +96,32 @@ private static Action<IConfigurator<CommandSettings>> ConfigureAnalyzerProviders
9696
.WithExample(new[] { CreateArgumentCommandsAnalyzerProvidersWithCleanupCache() });
9797
};
9898

99-
private static string CreateArgumentProjectPathWithDot() => $"{ArgumentCommandConstants.ShortProjectPath} .";
99+
private static string CreateArgumentProjectPathWithDot()
100+
=> $"{ArgumentCommandConstants.ShortProjectPath} .";
100101

101-
private static string CreateArgumentProjectPathWithCurrentFolder() => $"{ArgumentCommandConstants.ShortProjectPath} [CurrentFolder]";
102+
private static string CreateArgumentProjectPathWithCurrentFolder()
103+
=> $"{ArgumentCommandConstants.ShortProjectPath} [CurrentFolder]";
102104

103-
private static string CreateArgumentProjectPathWithTestFolder() => @$"{ArgumentCommandConstants.ShortProjectPath} c:\temp\MyProject";
105+
private static string CreateArgumentProjectPathWithTestFolder()
106+
=> @$"{ArgumentCommandConstants.ShortProjectPath} c:\temp\MyProject";
104107

105-
private static string CreateArgumentProjectTarget(SupportedProjectTargetType targetType) => @$"{ArgumentCommandConstants.ShortProjectTarget} {targetType}";
108+
private static string CreateArgumentProjectTarget(SupportedProjectTargetType targetType)
109+
=> @$"{ArgumentCommandConstants.ShortProjectTarget} {targetType}";
106110

107-
private static string CreateArgumentFetchMode(ProviderCollectingMode collectingMode) => @$"{ArgumentCommandConstants.LongFetchMode} {collectingMode}";
111+
private static string CreateArgumentFetchMode(ProviderCollectingMode collectingMode)
112+
=> @$"{ArgumentCommandConstants.LongFetchMode} {collectingMode}";
108113

109-
private static string CreateArgumentCommandsAnalyzerProvidersWithCollect() => $"{NameCommandConstants.AnalyzerProviders} {NameCommandConstants.AnalyzerProvidersCollect}";
114+
private static string CreateArgumentCommandsAnalyzerProvidersWithCollect()
115+
=> $"{NameCommandConstants.AnalyzerProviders} {NameCommandConstants.AnalyzerProvidersCollect}";
110116

111-
private static string CreateArgumentCommandsOptionsFileWithCreate() => $"{NameCommandConstants.OptionsFile} {NameCommandConstants.OptionsFileCreate}";
117+
private static string CreateArgumentCommandsOptionsFileWithCreate()
118+
=> $"{CommandConstants.NameOptionsFile} {CommandConstants.NameOptionsFileCreate}";
112119

113-
private static string CreateArgumentCommandsOptionsFileWithValidate() => $"{NameCommandConstants.OptionsFile} {NameCommandConstants.OptionsFileValidate}";
120+
private static string CreateArgumentCommandsOptionsFileWithValidate()
121+
=> $"{CommandConstants.NameOptionsFile} {CommandConstants.NameOptionsFileValidate}";
114122

115-
private static string CreateArgumentCommandsAnalyzerProvidersWithCleanupCache() => $"{NameCommandConstants.AnalyzerProviders} {NameCommandConstants.AnalyzerProvidersCleanupCache}";
123+
private static string CreateArgumentCommandsAnalyzerProvidersWithCleanupCache()
124+
=> $"{NameCommandConstants.AnalyzerProviders} {NameCommandConstants.AnalyzerProvidersCleanupCache}";
116125

117126
private static string CreateEquivalentToRun(int indentSpaces)
118127
=> PrefixSpaces(indentSpaces, $"(equivalent to '{NameCommandConstants.Run} {CreateArgumentProjectPathWithCurrentFolder()}')");

src/Atc.CodingRules.Updater.CLI/GlobalUsings.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,19 @@
66
global using System.Diagnostics.CodeAnalysis;
77
global using System.Globalization;
88
global using System.Text;
9-
global using System.Text.Json;
109

1110
global using Atc.CodingRules.AnalyzerProviders;
1211
global using Atc.CodingRules.AnalyzerProviders.Models;
1312
global using Atc.CodingRules.Updater.CLI.Commands;
1413
global using Atc.CodingRules.Updater.CLI.Commands.DescriptionAttributes;
1514
global using Atc.CodingRules.Updater.CLI.Commands.Settings;
1615
global using Atc.CodingRules.Updater.CLI.Extensions;
17-
global using Atc.CodingRules.Updater.CLI.Models;
1816
global using Atc.Console.Spectre;
1917
global using Atc.Console.Spectre.CommandSettings;
2018
global using Atc.Console.Spectre.Factories;
2119
global using Atc.Console.Spectre.Helpers;
2220
global using Atc.Console.Spectre.Logging;
2321
global using Atc.Helpers;
24-
global using Atc.Serialization;
2522

2623
global using Microsoft.Extensions.Configuration;
2724
global using Microsoft.Extensions.Logging;

0 commit comments

Comments
 (0)