Skip to content

Commit

Permalink
[Dependencies] Updating Nullable.Extended.Analyzer (Code analysis) to…
Browse files Browse the repository at this point in the history
… 1.14.6129 (#200)

<!--- Provide a general summary of your changes in the Title above that
includes the Jira Ticket -->

# Description
<!--- Describe your changes in detail -->

# Related Issue\Feature
<!--- Please link to the issue or feature: -->

# How Has This Been Tested
- [ ] All unit tests pass.
- [ ] All integration tests pass.
- [ ] Manual Testing:
<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, and the tests you ran
to -->
<!--- see how your change affects other areas of the code, etc. -->

# Types of changes
<!--- What types of changes does your code introduce? Put an 'x' in all
the boxes that apply: -->
<!-- Note that you can just click these after submission and it will
remember the tick for you -->
- [ ] Docs change
- [ ] Refactoring
- [ ] Dependency upgrade
- [ ] Additional Unit Tests\Integration Tests
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Removed no-longer used code

## Deployment Configuration Changes
- [ ] Requires deployment configuration changes as specified below and
in CHANGELOG.md
<!--- Insert Deployment configuration changes here -->

# Checklist
<!--- Go over all the following points, and put an 'x' in all the boxes
once they are true. -->
<!-- Note that you can just click these after submission and it will
remember the tick for you -->
- [ ] There are no Resharper\static code analysis errors anywhere in the
solution.
- [ ] I have ONLY run a code clean-up on any files I have modified to
make sure they are in the correct format and no others.
- [ ] I have added tests to cover my changes.
- [ ] I have run the code and quickly verified it all works to my
satisfaction.
- [ ] All new/modified code has sufficient logging to be able to
diagnose what is wrong.
- [ ] All new and existing tests passed.
- [ ] All new/modified public interfaces/classes have are documented
with xmldoc comments.
- [ ] Unreleased section of CHANGELOG.md has been updated with details
of this PR.
  • Loading branch information
credfeto authored Dec 9, 2023
2 parents 685b5d4 + c6a564e commit 06ec3c2
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 11 deletions.
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

0 comments on commit 06ec3c2

Please sign in to comment.