Skip to content

Commit

Permalink
Enable Roslynator Analyzers via Nuget Package
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinGrote committed Dec 4, 2024
1 parent a5aaad8 commit b5d92e0
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 4 deletions.
14 changes: 13 additions & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@
<PackageVersion Include="OmniSharp.Extensions.LanguageClient" Version="0.19.9" />
<PackageVersion Include="OmniSharp.Extensions.LanguageServer" Version="0.19.9" />
<PackageVersion Include="PowerShellStandard.Library" Version="5.1.1" />
<PackageVersion Include="Roslynator.Analyzers" Version="4.12.9">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageVersion>
<PackageVersion Include="Roslynator.CodeAnalysis.Analyzers" Version="4.12.9">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageVersion>
<PackageVersion Include="Roslynator.Formatting.Analyzers" Version="4.12.9">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageVersion>
<PackageVersion Include="System.IO.Pipes.AccessControl" Version="5.0.0" />
<PackageVersion Include="System.Runtime.InteropServices.RuntimeInformation" Version="4.3.0" />
<PackageVersion Include="System.Security.Principal" Version="4.3.0" />
Expand All @@ -22,4 +34,4 @@
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.2" />
<PackageVersion Include="Xunit.SkippableFact" Version="1.4.13" />
</ItemGroup>
</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ public void LogException(
/// <param name="ui">The PowerShell host user interface object to log output to.</param>
internal class PSHostLogger(PSHostUserInterface ui) : IObserver<(PsesLogLevel logLevel, string message)>
{

public void OnCompleted()
{
// No-op since there's nothing to close or dispose,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), PowerShellEditorServices.Common.props))\PowerShellEditorServices.Common.props" />
<Import
Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), PowerShellEditorServices.Common.props))\PowerShellEditorServices.Common.props" />

<PropertyGroup>
<TargetFrameworks>net8.0;net462</TargetFrameworks>
Expand All @@ -16,6 +17,12 @@
<PackageReference Include="System.Runtime.InteropServices.RuntimeInformation" />
</ItemGroup>

<ItemGroup Label="Roslynator">
<PackageReference Include="Roslynator.Analyzers" />
<PackageReference Include="Roslynator.CodeAnalysis.Analyzers" />
<PackageReference Include="Roslynator.Formatting.Analyzers" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\PowerShellEditorServices\PowerShellEditorServices.csproj" PrivateAssets="all" />
</ItemGroup>
Expand Down
9 changes: 8 additions & 1 deletion src/PowerShellEditorServices/PowerShellEditorServices.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), PowerShellEditorServices.Common.props))\PowerShellEditorServices.Common.props" />
<Import
Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), PowerShellEditorServices.Common.props))\PowerShellEditorServices.Common.props" />

<PropertyGroup>
<AssemblyTitle>PowerShell Editor Services</AssemblyTitle>
Expand Down Expand Up @@ -41,6 +42,12 @@
<PackageReference Include="System.Security.Principal.Windows" />
</ItemGroup>

<ItemGroup Label="Roslynator">
<PackageReference Include="Roslynator.Analyzers" />
<PackageReference Include="Roslynator.CodeAnalysis.Analyzers" />
<PackageReference Include="Roslynator.Formatting.Analyzers" />
</ItemGroup>

<Choose>
<When Condition=" '$(LocalOmniSharp)' == 'true' ">
<ItemGroup>
Expand Down

0 comments on commit b5d92e0

Please sign in to comment.