Skip to content

Upgrade packages #1279

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

Merged
merged 1 commit into from
Dec 29, 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
5 changes: 2 additions & 3 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,8 @@
Use fixed version of analyzers.
-->
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="8.0.0-preview1.23165.1" PrivateAssets="all" />
Copy link
Collaborator

@WojciechNagorski WojciechNagorski Dec 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove reference to Microsoft.CodeAnalysis.NetAnalyzers (use the stable version by default)

You should not remove this package because of .NET Framework do not have analyzers by default, should you?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to https://www.nuget.org/packages/Microsoft.CodeAnalysis.NetAnalyzers, it is included by virtue of <EnableNETAnalyzers>true</EnableNETAnalyzers> on line 21

Copy link
Collaborator

@WojciechNagorski WojciechNagorski Dec 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But I think you still need to install Nuget. Can you check it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The packages README says

You do not need to manually install this NuGet package to your project if you are using .NET5 SDK or later

We are using .NET8 SDK. An example of a CA analyzer on net462 target:

image

<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.435" PrivateAssets="all" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.556" PrivateAssets="all" />
<PackageReference Include="Meziantou.Analyzer" Version="2.0.103" PrivateAssets="all" />
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.12.0.78982" PrivateAssets="all" />
<PackageReference Include="SonarAnalyzer.CSharp" Version="9.16.0.82469" PrivateAssets="all" />
</ItemGroup>
</Project>
4 changes: 2 additions & 2 deletions build/nuget/SSH.NET.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
<tags>ssh scp sftp</tags>
<dependencies>
<group targetFramework="net462">
<dependency id="Microsoft.Bcl.AsyncInterfaces" version="[7.0.0]" />
<dependency id="Microsoft.Bcl.AsyncInterfaces" version="[8.0.0]" />
</group>
<group targetFramework="netstandard2.0">
<dependency id="Microsoft.Bcl.AsyncInterfaces" version="[7.0.0]" />
<dependency id="Microsoft.Bcl.AsyncInterfaces" version="[8.0.0]" />
<dependency id="SshNet.Security.Cryptography" version="[1.3.0]" />
</group>
<group targetFramework="netstandard2.1">
Expand Down
2 changes: 1 addition & 1 deletion src/Renci.SshNet/Renci.SshNet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net462' or '$(TargetFramework)' == 'netstandard2.0' ">
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="7.0.0" />
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0" />
</ItemGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' or '$(TargetFramework)' == 'netstandard2.1' or '$(TargetFramework)' == 'net6.0' or '$(TargetFramework)' == 'net7.0' or '$(TargetFramework)' == 'net8.0' ">
Expand Down
5 changes: 5 additions & 0 deletions test/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,11 @@ dotnet_diagnostic.CA1711.severity = none
# We do not care about this for unit tests.
dotnet_diagnostic.CA1720.severity = none

# CA1861: Avoid constant arrays as arguments
#
# We do not care about this for unit tests.
dotnet_diagnostic.CA1861.severity = none

# CA5351: Do not use broken cryptographic algorithms
#
# We do not care about this for unit tests.
Expand Down
2 changes: 1 addition & 1 deletion test/Renci.SshNet.IntegrationTests/HostConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public static HostConfig Read(ScpClient scpClient, string path)
while ((line = sr.ReadLine()) != null)
{
// skip comments
if (line.StartsWith("#"))
if (line.StartsWith('#'))
{
continue;
}
Expand Down