Skip to content

Commit

Permalink
chore: migrate to Microsoft.CodeAnalysis.NetAnalyzers (#234)
Browse files Browse the repository at this point in the history
  • Loading branch information
RLittlesII committed Feb 10, 2024
1 parent 2095ebe commit b5ba3d3
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 10 deletions.
8 changes: 6 additions & 2 deletions .nuke/build.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
"GenerateCodeCoverageReportCobertura",
"GenerateCodeCoverageSummary",
"GenerateReadme",
"GitHubActions",
"JetBrainsCleanupCode",
"Lint",
"LintGitAdd",
Expand All @@ -113,7 +114,8 @@
"Restore",
"ShipPublicApis",
"Test",
"TriggerCodeCoverageReports"
"TriggerCodeCoverageReports",
"Workloads"
]
}
},
Expand Down Expand Up @@ -141,6 +143,7 @@
"GenerateCodeCoverageReportCobertura",
"GenerateCodeCoverageSummary",
"GenerateReadme",
"GitHubActions",
"JetBrainsCleanupCode",
"Lint",
"LintGitAdd",
Expand All @@ -153,7 +156,8 @@
"Restore",
"ShipPublicApis",
"Test",
"TriggerCodeCoverageReports"
"TriggerCodeCoverageReports",
"Workloads"
]
}
},
Expand Down
2 changes: 2 additions & 0 deletions Airframe.sln
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "config", "config", "{786B1A
.gitignore = .gitignore
NuGet.config = NuGet.config
renovate.json = renovate.json
qodana.yaml = qodana.yaml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{6813747B-13DB-4144-AB19-22C84E734517}"
Expand All @@ -104,6 +105,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{
.github/workflows/publish-nuget.yml = .github/workflows/publish-nuget.yml
.github/workflows/sync-labels.yml = .github/workflows/sync-labels.yml
.github/workflows/update-milestone.yml = .github/workflows/update-milestone.yml
.github/workflows/qodana.yml = .github/workflows/qodana.yml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".husky", ".husky", "{F9E0EBA5-5737-440E-8F30-20CCFC207E9E}"
Expand Down
2 changes: 1 addition & 1 deletion directory.packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</ItemGroup>
<ItemGroup>
<PackageVersion Include="stylecop.analyzers" Version="1.2.0-beta.556" PrivateAssets="all" />
<PackageVersion Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.3.2" PrivateAssets="all" />
<PackageVersion Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="8.0.0" PrivateAssets="all" />
<PackageVersion Include="Roslynator.Analyzers" Version="4.8.0" PrivateAssets="All" />
</ItemGroup>
<ItemGroup>
Expand Down
19 changes: 16 additions & 3 deletions src/ViewModels/NavigableViewModelBase.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Reactive.Linq;

Check warning on line 2 in src/ViewModels/NavigableViewModelBase.cs

View workflow job for this annotation

GitHub Actions / Qodana for .NET

Redundant using directive

Using directive is not required by the code and can be safely removed
using System.Reactive.Subjects;

Check warning on line 3 in src/ViewModels/NavigableViewModelBase.cs

View workflow job for this annotation

GitHub Actions / Qodana for .NET

Redundant using directive

Using directive is not required by the code and can be safely removed
using ReactiveMarbles.Extensions;

Check warning on line 4 in src/ViewModels/NavigableViewModelBase.cs

View workflow job for this annotation

GitHub Actions / Qodana for .NET

Redundant using directive

Using directive is not required by the code and can be safely removed
using Rocket.Surgery.Airframe.Navigation;

namespace Rocket.Surgery.Airframe.ViewModels;
Expand All @@ -10,6 +11,16 @@ namespace Rocket.Surgery.Airframe.ViewModels;
/// </summary>
public abstract class NavigableViewModelBase : ViewModelBase, INavigated, IDestructible, IInitialize
{
/// <summary>
/// Initializes a new instance of the <see cref="NavigableViewModelBase"/> class.
/// </summary>
protected NavigableViewModelBase()
{
_initialize = new AsyncSubject<IArguments>().DisposeWith(Garbage);
_navigatedTo = new Subject<IArguments>().DisposeWith(Garbage);
_navigatedFrom = new Subject<IArguments>().DisposeWith(Garbage);
}

/// <inheritdoc/>
void IInitialize.OnInitialize(IArguments arguments)
{
Expand Down Expand Up @@ -55,7 +66,9 @@ protected virtual void Destroy()
{
}

private readonly AsyncSubject<IArguments> _initialize = new AsyncSubject<IArguments>();
private readonly Subject<IArguments> _navigatedTo = new Subject<IArguments>();
private readonly Subject<IArguments> _navigatedFrom = new Subject<IArguments>();
#pragma warning disable CA2213
private readonly AsyncSubject<IArguments> _initialize;
private readonly Subject<IArguments> _navigatedTo;
private readonly Subject<IArguments> _navigatedFrom;
#pragma warning restore CA2213
}
2 changes: 1 addition & 1 deletion src/directory.build.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="stylecop.analyzers" />
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" />
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" />
<PackageReference Include="Roslynator.Analyzers" />
</ItemGroup>
<ItemGroup>
Expand Down
7 changes: 4 additions & 3 deletions test/Composition.Tests/DryIocModuleTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ public void Should_Resolve_Module()

result.Resolve<TestModule>().Should().NotBeNull();
}
[Fact]
public void Should_Resolve_Module_Registrations()
{

[Fact]
public void Should_Resolve_Module_Registrations()
{
// Given
IContainer sut = new Container();

Expand Down

0 comments on commit b5ba3d3

Please sign in to comment.