Skip to content

Commit 4cb7f1f

Browse files
committed
Merge pull request #71 from atc-net/feature/Move-some-code-to-nuget-packages
Feature/move some code to nuget packages
2 parents 2fe68c6 + 353cb5b commit 4cb7f1f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+230
-266
lines changed

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
<ItemGroup Label="Code Analyzers">
4444
<PackageReference Include="AsyncFixer" Version="1.5.1" PrivateAssets="All" />
4545
<PackageReference Include="Asyncify" Version="0.9.7" PrivateAssets="All" />
46-
<PackageReference Include="Meziantou.Analyzer" Version="1.0.689" PrivateAssets="All" />
46+
<PackageReference Include="Meziantou.Analyzer" Version="1.0.694" PrivateAssets="All" />
4747
<PackageReference Include="SecurityCodeScan.VS2019" Version="5.6.0" PrivateAssets="All" />
4848
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" />
4949
<PackageReference Include="SonarAnalyzer.CSharp" Version="8.35.0.42613" PrivateAssets="All" />

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -169,15 +169,15 @@ Running the command above produces the following output
169169
|_| \_\ \__,_| |_| \___| |___/ \__,_| | .__/ \__,_| \__,_| \__| \___| |_|
170170
|_|
171171
🐭 Working on EditorConfig files
172-
🟢 /.editorconfig files merged
173-
🟢 sample/.editorconfig created
174-
🟢 src/.editorconfig created
175-
🟢 test/.editorconfig created
172+
🟢 root: .editorconfig files merged
173+
🟢 sample: .editorconfig created
174+
🟢 src: .editorconfig created
175+
🟢 test: .editorconfig created
176176
🔨 Working on Directory.Build.props files
177-
🟢 /Directory.Build.props created
178-
🟢 sample/Directory.Build.props created
179-
🟢 src/Directory.Build.props created
180-
🟢 test/Directory.Build.props created
177+
🟢 root: Directory.Build.props created
178+
🟢 sample: Directory.Build.props created
179+
🟢 src: Directory.Build.props created
180+
🟢 test: Directory.Build.props created
181181
✅ Done
182182
```
183183

src/Atc.CodingRules.AnalyzerProviders/Atc.CodingRules.AnalyzerProviders.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
</PropertyGroup>
1010

1111
<ItemGroup>
12-
<PackageReference Include="Atc" Version="1.1.385" />
13-
<PackageReference Include="HtmlAgilityPack" Version="1.11.40" />
12+
<PackageReference Include="Atc" Version="2.0.55" />
13+
<PackageReference Include="HtmlAgilityPack" Version="1.11.42" />
1414
</ItemGroup>
1515

1616
<ItemGroup>

src/Atc.CodingRules.AnalyzerProviders/Providers/AnalyzerProviderBase.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ namespace Atc.CodingRules.AnalyzerProviders.Providers;
22

33
public abstract class AnalyzerProviderBase : IAnalyzerProvider
44
{
5-
[SuppressMessage("Minor Code Smell", "S1075:URIs should not be hardcoded", Justification = "OK.")]
6-
private const string GitRawAtcAnalyzerProviderBaseRulesBasePath = "https://raw.githubusercontent.com/atc-net/atc-coding-rules-updater/main/AnalyzerProviderBaseRules/";
5+
private const string GitRawAtcAnalyzerProviderBaseRulesBasePath = Constants.GitRawContentUrl + "/atc-net/atc-coding-rules-updater/main/AnalyzerProviderBaseRules/";
76
private readonly ILogger logger;
87
private readonly bool logWithAnsiConsoleMarkup;
98

@@ -133,7 +132,12 @@ protected static Task WriteToTempFolder(
133132
{
134133
ArgumentNullException.ThrowIfNull(data);
135134

136-
var rawGitData = HttpClientHelper.GetAsString(logger, GitRawAtcAnalyzerProviderBaseRulesBasePath + data.Name + ".json");
135+
var url = GitRawAtcAnalyzerProviderBaseRulesBasePath + data.Name + ".json";
136+
var displayName = url.Replace(Constants.GitRawContentUrl, Constants.GitHubPrefix, StringComparison.Ordinal);
137+
var rawGitData = HttpClientHelper.GetAsString(
138+
logger,
139+
url,
140+
displayName);
137141
return Task.FromResult(string.IsNullOrEmpty(rawGitData)
138142
? null
139143
: JsonSerializer.Deserialize<AnalyzerProviderBaseRuleData>(rawGitData, AnalyzerProviderSerialization.JsonOptions)!);

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
</PropertyGroup>
1313

1414
<ItemGroup>
15-
<PackageReference Include="Atc" Version="1.1.385" />
16-
<PackageReference Include="Atc.Console.Spectre" Version="1.1.385" />
17-
<PackageReference Include="EPPlus" Version="5.8.5" />
18-
<PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.0" />
15+
<PackageReference Include="Atc" Version="2.0.55" />
16+
<PackageReference Include="Atc.Console.Spectre" Version="2.0.55" />
17+
<PackageReference Include="EPPlus" Version="5.8.6" />
18+
<PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.1" />
1919
</ItemGroup>
2020

2121
<ItemGroup>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public override int Execute(CommandContext context)
2121
return ConsoleExitStatusCodes.Failure;
2222
}
2323

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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ await AnalyzerProviderBaseRulesHelper.GetAnalyzerProviderBaseRules(
3737
return ConsoleExitStatusCodes.Failure;
3838
}
3939

40-
logger.LogInformation($"{EmojisConstants.Done} Done");
40+
logger.LogInformation($"{EmojisConstants.Success} 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.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace Atc.CodingRules.Updater.CLI.Commands.DescriptionAttributes;
44

5-
[AttributeUsage(AttributeTargets.All)]
5+
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Enum | AttributeTargets.Interface | AttributeTargets.Delegate)]
66
public sealed class ProviderCollectingModeDescriptionAttribute : DescriptionAttribute
77
{
88
public override string Description

0 commit comments

Comments
 (0)