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

Add .nupkg baseline with Verify #30

Merged
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
14 changes: 14 additions & 0 deletions Source/Moq.Analyzers.Test/ModuleInitializer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
namespace Moq.Analyzers.Test
{
using System.Runtime.CompilerServices;
using VerifyTests;

public static class ModuleInitializer
{
[ModuleInitializer]
public static void Initialize()
{
VerifyNupkg.Initialize();
}
}
}
8 changes: 6 additions & 2 deletions Source/Moq.Analyzers.Test/Moq.Analyzers.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="GetPackFromProject" Version="1.0.6">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" />
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="2.9.3" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="2.6.1" />
Expand All @@ -26,6 +30,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Verify.Nupkg" Version="1.1.1" />
<PackageReference Include="Verify.Xunit" Version="24.2.0" />
<PackageReference Include="xunit" Version="2.8.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.1">
Expand All @@ -34,8 +39,7 @@
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Moq.Analyzers\Moq.Analyzers.csproj">
</ProjectReference>
<ProjectReference Include="..\Moq.Analyzers\Moq.Analyzers.csproj" AddPackageAsOutput="true" />
</ItemGroup>
<ItemGroup>
<Compile Update="Data\CallbackSignatureShouldMatchMockedMethod.cs">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/
|-- Moq.Analyzers.nuspec
|-- analyzers
| |-- dotnet
| | |-- cs
| | | |-- Moq.Analyzers.dll
|-- lib
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Since this is an analyzer package and there's no "shipping" code, I don't think the lib/ directory should be in the package. Tracked by #31.

Copy link
Owner

Choose a reason for hiding this comment

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

Related to #8?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, likely. 0.0.8 puts it in both places like this change has. 0.0.9 is missing the analyzer.

So I think #8 will be fixed in the next release either way, and also we should ship the analyzer as a lib.

| |-- netstandard2.0
| | |-- Moq.Analyzers.dll
|-- tools
| |-- install.ps1
| |-- uninstall.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<package>
<metadata>
<id>Moq.Analyzers</id>
<version>********</version>
<authors>Andrey "Litee" Lipatkin</authors>
<licenseUrl>https://github.com/Litee/moq.analyzers/blob/master/LICENSE</licenseUrl>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We should switch from the old <licenseUrl> to the new <licenseExpression>. Tracked by #31.

<projectUrl>https://github.com/Litee/moq.analyzers</projectUrl>
<description>Roslyn analyzer that helps to write unit tests using Moq mocking library by highlighting typical errors and suggesting quick fixes. Port of Resharper extension to Roslyn. Find the full list of detected issues at project GitHub page.</description>
<releaseNotes>Upgraded to support Visual Studio 2019</releaseNotes>
<copyright>2015-2019 Andrey Lipatkin</copyright>
<tags>moq, mock, test, analyzers</tags>
<repository type="git" commit="****************************************" />
<dependencies>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We probably want to mark ourselves as a dev dependency. Tracked in #31.

<group targetFramework=".NETStandard2.0" />
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Since this is an analyzer only, there's no shipping code, and hence no dependencies, so I don't think this should be here. Tracked by #31.

</dependencies>
</metadata>
</package>
28 changes: 28 additions & 0 deletions Source/Moq.Analyzers.Test/PackageTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
namespace Moq.Analyzers.Test
{
using System.IO;
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
using Xunit;

public class PackageTests
{
private static readonly FileInfo Package;

static PackageTests()
{
Package = new FileInfo(Assembly.GetExecutingAssembly().Location)
.Directory!
.GetFiles("Moq.Analyzers*.nupkg")
.OrderByDescending(f => f.LastWriteTimeUtc)
.First();
}

[Fact]
public Task Baseline()
{
return VerifyFile(Package).ScrubNuspec();
}
}
}
Loading