Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Dependencies] Updating Nullable.Extended.Analyzer (Code analysis) to 1.14.6129 #200

Merged
merged 2 commits into from
Dec 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Please ADD ALL Changes to the UNRELEASED SECTION and not a specific release
### Changed
- Dependencies - Updated Meziantou.Analyzer to 2.0.119
- Dependencies - Updated SonarAnalyzer.CSharp to 9.15.0.81779
- Dependencies - Updated Nullable.Extended.Analyzer to 1.14.6129
### Removed
### Deployment Changes

Expand Down
2 changes: 1 addition & 1 deletion src/Credfeto.ChangeLog.Cmd/Credfeto.ChangeLog.Cmd.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
<PackageReference Include="FunFair.CodeAnalysis" Version="7.0.4.198" PrivateAssets="All" ExcludeAssets="runtime" />
<PackageReference Include="Meziantou.Analyzer" Version="2.0.119" PrivateAssets="All" ExcludeAssets="runtime" />
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.8.14" PrivateAssets="All" ExcludeAssets="runtime" />
<PackageReference Include="Nullable.Extended.Analyzer" Version="1.10.4539" PrivateAssets="All" ExcludeAssets="runtime" />
<PackageReference Include="Nullable.Extended.Analyzer" Version="1.14.6129" PrivateAssets="All" ExcludeAssets="runtime" />
<PackageReference Include="Philips.CodeAnalysis.DuplicateCodeAnalyzer" Version="1.1.7" PrivateAssets="All" ExcludeAssets="runtime" />
<PackageReference Include="Philips.CodeAnalysis.MaintainabilityAnalyzers" Version="1.4.0" PrivateAssets="All" ExcludeAssets="runtime" />
<PackageReference Include="Roslynator.Analyzers" Version="4.7.0" PrivateAssets="All" ExcludeAssets="runtime" />
Expand Down
51 changes: 43 additions & 8 deletions src/Credfeto.ChangeLog.Cmd/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,17 +93,22 @@ private static async Task OutputUnreleasedContentAsync(Options options, Cancella

private static Task CreateNewReleaseAsync(Options options, in CancellationToken cancellationToken)
{
string releaseVersion = options.CreateRelease!;
string releaseVersion = GetCreateRelease(options);
string changeLog = FindChangeLog(options);
Console.WriteLine($"Using Changelog {changeLog}");
Console.WriteLine($"Release Version: {releaseVersion}");

return ChangeLogUpdater.CreateReleaseAsync(changeLogFileName: changeLog, version: releaseVersion, pending: options.Pending, cancellationToken: cancellationToken);
}

private static string GetCreateRelease(Options options)
{
return options.CreateRelease ?? throw new InvalidOptionsException(nameof(options.CreateRelease) + " is null");
}

private static async Task CheckInsertPositionAsync(Options options, CancellationToken cancellationToken)
{
string originBranchName = options.CheckInsert!;
string originBranchName = GetCheckInsert(options);
string changeLog = FindChangeLog(options);
Console.WriteLine($"Using Changelog {changeLog}");
Console.WriteLine($"Branch: {originBranchName}");
Expand All @@ -119,10 +124,15 @@ private static async Task CheckInsertPositionAsync(Options options, Cancellation
throw new ChangeLogInvalidFailedException("Changelog modified in released section");
}

private static string GetCheckInsert(Options options)
{
return options.CheckInsert ?? throw new InvalidOptionsException(nameof(options.CheckInsert) + " is null");
}

private static Task AddEntryToUnreleasedChangelogAsync(Options options, in CancellationToken cancellationToken)
{
string changeType = options.Add!;
string message = options.Message!;
string changeType = GetAdd(options);
string message = GetMessage(options);
string changeLog = FindChangeLog(options);
Console.WriteLine($"Using Changelog {changeLog}");
Console.WriteLine($"Change Type: {changeType}");
Expand All @@ -131,10 +141,15 @@ private static Task AddEntryToUnreleasedChangelogAsync(Options options, in Cance
return ChangeLogUpdater.AddEntryAsync(changeLogFileName: changeLog, type: changeType, message: message, cancellationToken: cancellationToken);
}

private static string GetAdd(Options options)
{
return options.Add ?? throw new InvalidOptionsException(nameof(options.Add) + " is null");
}

private static Task RemoveEntryFromUnreleasedChangelogAsync(Options options, in CancellationToken cancellationToken)
{
string changeType = options.Remove!;
string message = options.Message!;
string changeType = GetChangeType(options);
string message = GetMessage(options);
string changeLog = FindChangeLog(options);
Console.WriteLine($"Using Changelog {changeLog}");
Console.WriteLine($"Change Type: {changeType}");
Expand All @@ -143,10 +158,20 @@ private static Task RemoveEntryFromUnreleasedChangelogAsync(Options options, in
return ChangeLogUpdater.RemoveEntryAsync(changeLogFileName: changeLog, type: changeType, message: message, cancellationToken: cancellationToken);
}

private static string GetChangeType(Options options)
{
return options.Remove ?? throw new InvalidOptionsException(nameof(options.Remove) + " is null");
}

private static string GetMessage(Options options)
{
return options.Message ?? throw new InvalidOptionsException(nameof(options.Message) + " is null");
}

private static async Task ExtractChangeLogTextForVersionAsync(Options options, CancellationToken cancellationToken)
{
string outputFileName = options.Extract!;
string version = options.Version!;
string outputFileName = GetExtract(options);
string version = GetVersion(options);
string changeLog = FindChangeLog(options);
Console.WriteLine($"Using Changelog {changeLog}");
Console.WriteLine($"Version {version}");
Expand All @@ -156,6 +181,16 @@ private static async Task ExtractChangeLogTextForVersionAsync(Options options, C
await File.WriteAllTextAsync(path: outputFileName, contents: text, encoding: Encoding.UTF8, cancellationToken: cancellationToken);
}

private static string GetVersion(Options options)
{
return options.Version ?? throw new InvalidOptionsException(nameof(options.Version) + " is null");
}

private static string GetExtract(Options options)
{
return options.Extract ?? throw new InvalidOptionsException(nameof(options.Extract) + " is null");
}

private static void NotParsed(IEnumerable<Error> errors)
{
Console.WriteLine("Errors:");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
<PackageReference Include="Meziantou.Analyzer" Version="2.0.119" PrivateAssets="All" ExcludeAssets="runtime" />
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.8.14" PrivateAssets="All" ExcludeAssets="runtime" />
<PackageReference Include="NSubstitute.Analyzers.CSharp" Version="1.0.16" PrivateAssets="All" ExcludeAssets="runtime" />
<PackageReference Include="Nullable.Extended.Analyzer" Version="1.10.4539" PrivateAssets="All" ExcludeAssets="runtime" />
<PackageReference Include="Nullable.Extended.Analyzer" Version="1.14.6129" PrivateAssets="All" ExcludeAssets="runtime" />
<PackageReference Include="Philips.CodeAnalysis.DuplicateCodeAnalyzer" Version="1.1.7" PrivateAssets="All" ExcludeAssets="runtime" />
<PackageReference Include="Philips.CodeAnalysis.MaintainabilityAnalyzers" Version="1.4.0" PrivateAssets="All" ExcludeAssets="runtime" />
<PackageReference Include="Roslynator.Analyzers" Version="4.7.0" PrivateAssets="All" ExcludeAssets="runtime" />
Expand Down
2 changes: 1 addition & 1 deletion src/Credfeto.ChangeLog/Credfeto.ChangeLog.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<PackageReference Include="FunFair.CodeAnalysis" Version="7.0.4.198" PrivateAssets="All" ExcludeAssets="runtime" />
<PackageReference Include="Meziantou.Analyzer" Version="2.0.119" PrivateAssets="All" ExcludeAssets="runtime" />
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.8.14" PrivateAssets="All" ExcludeAssets="runtime" />
<PackageReference Include="Nullable.Extended.Analyzer" Version="1.10.4539" PrivateAssets="All" ExcludeAssets="runtime" />
<PackageReference Include="Nullable.Extended.Analyzer" Version="1.14.6129" PrivateAssets="All" ExcludeAssets="runtime" />
<PackageReference Include="Philips.CodeAnalysis.DuplicateCodeAnalyzer" Version="1.1.7" PrivateAssets="All" ExcludeAssets="runtime" />
<PackageReference Include="Philips.CodeAnalysis.MaintainabilityAnalyzers" Version="1.4.0" PrivateAssets="All" ExcludeAssets="runtime" />
<PackageReference Include="Roslynator.Analyzers" Version="4.7.0" PrivateAssets="All" ExcludeAssets="runtime" />
Expand Down
Loading