Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
7c86d1b
test: add fixtures reproducing CPM and .slnx failures
Tymisko Sep 11, 2026
3726bc1
fix: support Central Package Management
Tymisko Sep 11, 2026
42956cc
fix: compare equal version ranges correctly
Tymisko Sep 11, 2026
e5434df
feat: support slnx solution files
Tymisko Sep 11, 2026
49d60ab
test: cover package version parsing
Tymisko Sep 11, 2026
88a8a3c
docs: mention slnx and Central Package Management support
Tymisko Sep 11, 2026
a0f8637
test: show that versions are lost under Central Package Management
Tymisko Sep 11, 2026
344460b
fix: resolve versions of centrally managed packages
Tymisko Sep 11, 2026
905b95c
test: cover slnx solution folders and directory probing
Tymisko Sep 11, 2026
67db8be
fix: don't crash on a multi targeting project when --tfm is given
Tymisko Sep 11, 2026
2470c72
test: cover a project referencing a centrally managed one
Tymisko Sep 11, 2026
c052990
test: cover transitive depth and inline versions under central manage…
Tymisko Sep 11, 2026
04f8322
fix: pick the centrally managed version of the right target framework
Tymisko Sep 11, 2026
8b6b93c
test: use the full slnx schema in the fixture
Tymisko Sep 11, 2026
69f16b3
test: cover slnx with --skip and an ambiguous directory
Tymisko Sep 11, 2026
3e61363
fix: don't merge two projects that share a file name
Tymisko Sep 11, 2026
7848220
fix: match the lock file target and the root project exactly
Tymisko Sep 11, 2026
9626c43
fix: honour PrivateAssets="all" on a referenced project's packages
Tymisko Sep 11, 2026
dc841df
fix: apply --exclude to the pre-release report as well
Tymisko Sep 11, 2026
59c4a5b
fix: discover an F# project when probing a directory
Tymisko Sep 11, 2026
387f6c8
ci: fix the stray brace in the runner label
Tymisko Sep 11, 2026
f83eecb
fix: escape user supplied text before writing it as markup
Tymisko Sep 11, 2026
923d012
fix: treat an exact version and the range it implies as the same
Tymisko Sep 11, 2026
738308e
fix: don't reuse a project across target frameworks
Tymisko Sep 11, 2026
018d49e
perf: reuse a single target project for any target framework
Tymisko Sep 11, 2026
e7002e1
test: cover a project whose name is also markup
Tymisko Sep 11, 2026
e26e759
fix: say which framework a project actually targets
Tymisko Sep 11, 2026
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
build:
name: Build
if: "!contains(github.event.head_commit.message, 'skip-ci')"
runs-on: ubuntu-latest}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@ target framework._
> snitch MyProject.csproj
```

_Examine a solution. Both `.sln` and `.slnx` solutions are supported,
as are projects using Central Package Management._

```
> snitch MySolution.slnx
```

_Examine a specific project using a specific
target framework moniker._

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Autofac" VersionOverride="4.9.3" />
<PackageReference Include="Newtonsoft.Json" />
<PackageReference Include="Serilog" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Qwerty\Qwerty.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace Asdf
{
public class Class1
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.13.36105.23
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Asdf", "Asdf\Asdf.csproj", "{0026E591-BDA2-59CD-C237-1513DA9668F8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Qwerty", "Qwerty\Qwerty.csproj", "{D9EE6D9A-329C-4B70-831C-EBDB4498C490}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{0026E591-BDA2-59CD-C237-1513DA9668F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0026E591-BDA2-59CD-C237-1513DA9668F8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0026E591-BDA2-59CD-C237-1513DA9668F8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0026E591-BDA2-59CD-C237-1513DA9668F8}.Release|Any CPU.Build.0 = Release|Any CPU
{D9EE6D9A-329C-4B70-831C-EBDB4498C490}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D9EE6D9A-329C-4B70-831C-EBDB4498C490}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D9EE6D9A-329C-4B70-831C-EBDB4498C490}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D9EE6D9A-329C-4B70-831C-EBDB4498C490}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {95C9EDD6-8E73-4BC8-9DD0-D25CE6E91111}
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<Project>

<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>

<ItemGroup>
<PackageVersion Include="Autofac" Version="4.9.4" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.2-beta2" />
<PackageVersion Include="Serilog" Version="2.12.0" />
</ItemGroup>

<ItemGroup>
<GlobalPackageReference Include="AsyncFixer" Version="1.6.0" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace Qwerty
{
public class Class1
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Autofac" />
<PackageReference Include="Newtonsoft.Json" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Zxcv\Zxcv.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace Uiop
{
public class Class1
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<!-- Pins a version inline even though versions are managed centrally. NuGet rejects
this during a normal restore, but the inline version is what must win here. -->
<ItemGroup>
<PackageReference Include="Autofac" Version="4.9.3" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Qwerty\Qwerty.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace Zxcv
{
public class Class1
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Serilog" />
</ItemGroup>

</Project>
15 changes: 15 additions & 0 deletions src/Snitch.Tests.Fixtures/ConditionalVersions/App/App.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Autofac" VersionOverride="4.9.2" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Lib\Lib.csproj" />
</ItemGroup>

</Project>
6 changes: 6 additions & 0 deletions src/Snitch.Tests.Fixtures/ConditionalVersions/App/Class1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace App
{
public class Class1
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<Project>

<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>

<ItemGroup>
<PackageVersion Include="Autofac" Version="4.9.4" Condition="'$(TargetFramework)' == 'net8.0'" />
<PackageVersion Include="Autofac" Version="4.9.3" Condition="'$(TargetFramework)' == 'net6.0'" />
</ItemGroup>

</Project>
6 changes: 6 additions & 0 deletions src/Snitch.Tests.Fixtures/ConditionalVersions/Lib/Class1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace Lib
{
public class Class1
{
}
}
11 changes: 11 additions & 0 deletions src/Snitch.Tests.Fixtures/ConditionalVersions/Lib/Lib.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Autofac" />
</ItemGroup>

</Project>
18 changes: 18 additions & 0 deletions src/Snitch.Tests.Fixtures/Duplicates/Consumer/Consumer.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Autofac" Version="4.9.4" />
<PackageReference Include="Serilog" Version="2.12.0" />
</ItemGroup>

<!-- Two different projects that happen to share a file name. -->
<ItemGroup>
<ProjectReference Include="..\First\Common.csproj" />
<ProjectReference Include="..\Second\Common.csproj" />
</ItemGroup>

</Project>
12 changes: 12 additions & 0 deletions src/Snitch.Tests.Fixtures/Duplicates/First/Common.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<AssemblyName>First.Common</AssemblyName>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Autofac" Version="4.9.4" />
</ItemGroup>

</Project>
12 changes: 12 additions & 0 deletions src/Snitch.Tests.Fixtures/Duplicates/Second/Common.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<AssemblyName>Second.Common</AssemblyName>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Serilog" Version="2.12.0" />
</ItemGroup>

</Project>
6 changes: 6 additions & 0 deletions src/Snitch.Tests.Fixtures/Grault/Class1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace Grault
{
public class Class1
{
}
}
15 changes: 15 additions & 0 deletions src/Snitch.Tests.Fixtures/Grault/Grault.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;net8.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Autofac" Version="4.9.4" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Foo\Foo.csproj" />
</ItemGroup>

</Project>
6 changes: 6 additions & 0 deletions src/Snitch.Tests.Fixtures/Legacy/Class1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace Legacy
{
public class Class1
{
}
}
19 changes: 19 additions & 0 deletions src/Snitch.Tests.Fixtures/Legacy/Legacy.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<OutputType>Library</OutputType>
<RootNamespace>Legacy</RootNamespace>
<AssemblyName>Legacy</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
</PropertyGroup>
<ItemGroup>
<Compile Include="Class1.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Target Name="Build" />
<Target Name="Restore" />
</Project>
4 changes: 4 additions & 0 deletions src/Snitch.Tests.Fixtures/Legacy/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="12.0.1" targetFramework="net472" />
</packages>
6 changes: 6 additions & 0 deletions src/Snitch.Tests.Fixtures/Markup/Weird[1]/Class1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace Markup.Weird
{
public class Class1
{
}
}
11 changes: 11 additions & 0 deletions src/Snitch.Tests.Fixtures/Markup/Weird[1]/Weird[1].csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
</ItemGroup>

</Project>
6 changes: 6 additions & 0 deletions src/Snitch.Tests.Fixtures/Migrating/Class1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace Migrating
{
public class Class1
{
}
}
17 changes: 17 additions & 0 deletions src/Snitch.Tests.Fixtures/Migrating/Migrating.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<!-- This project is outside the Central Package Management cone and pins
its version inline, while the project it references manages it centrally. -->
<ItemGroup>
<PackageReference Include="Autofac" Version="4.9.4" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\CentralizedPackageManagement\Qwerty\Qwerty.csproj" />
</ItemGroup>

</Project>
15 changes: 15 additions & 0 deletions src/Snitch.Tests.Fixtures/NonDotNet/App/App.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Native\Native.vcxproj" />
</ItemGroup>

</Project>
6 changes: 6 additions & 0 deletions src/Snitch.Tests.Fixtures/NonDotNet/App/Class1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace NonDotNet.App
{
public class Class1
{
}
}
8 changes: 8 additions & 0 deletions src/Snitch.Tests.Fixtures/NonDotNet/Native/Native.vcxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="Build" />
<Target Name="GetTargetFrameworks" />
<Target Name="GetTargetPath" />
<Target Name="GetNativeManifest" />
<Target Name="GetCopyToOutputDirectoryItems" />
</Project>
Loading
Loading