Skip to content
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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ Analyzing Thuuud...
│ ┌──────────────────┬──────────┬───────────────────────────────┐ │
│ │ Package │ Version │ Reason │ │
│ ├──────────────────┼──────────┼───────────────────────────────┤ │
│ │ Newtonsoft.Json │ 12.0.3 │ Updated from 12.0.1 in Foo │ │
│ │ Newtonsoft.Json │ 13.0.3 │ Updated from 13.0.1 in Foo │ │
│ │ Autofac │ 4.9.3 │ Downgraded from 4.9.4 in Foo │ │
│ └──────────────────┴──────────┴───────────────────────────────┘ │
│ │
│ Packages that might be removed from Thuuud: │
│ ┌─────────────────┬──────────────┬────────────────────────────┐ │
│ │ Package │ Version │ Reason │ │
│ ├─────────────────┼──────────────┼────────────────────────────┤ │
│ │ Newtonsoft.Json │ 13.0.2-beta2 │ Updated from 12.0.1 in Foo │ │
│ │ Newtonsoft.Json │ 13.0.2-beta2 │ Updated from 13.0.1 in Foo │ │
│ └─────────────────┴──────────────┴────────────────────────────┘ │
╰─────────────────────────────────────────────────────────────────╯
```
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"projects": [ "src" ],
"sdk": {
"version": "8.0.100",
"version": "10.0.100",
"rollForward": "latestFeature"
}
}
2 changes: 1 addition & 1 deletion src/Snitch.Tests.Fixtures/Foo/Foo.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

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

</Project>
2 changes: 1 addition & 1 deletion src/Snitch.Tests.Fixtures/Zap/Zap.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Autofac" Version="4.9.3" />
</ItemGroup>

Expand Down
4 changes: 2 additions & 2 deletions src/Snitch.Tests/Expectations/Slnx.Default.verified.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ Analyzing Thuuud...
│ ┌──────────────────┬──────────┬───────────────────────────────┐ │
│ │ Package │ Version │ Reason │ │
│ ├──────────────────┼──────────┼───────────────────────────────┤ │
│ │ Newtonsoft.Json │ 12.0.3 │ Updated from 12.0.1 in Foo │ │
│ │ Newtonsoft.Json │ 13.0.3 │ Updated from 13.0.1 in Foo │ │
│ │ Autofac │ 4.9.3 │ Downgraded from 4.9.4 in Foo │ │
│ └──────────────────┴──────────┴───────────────────────────────┘ │
│ │
│ Packages that might be removed from Thuuud: │
│ ┌─────────────────┬──────────────┬────────────────────────────┐ │
│ │ Package │ Version │ Reason │ │
│ ├─────────────────┼──────────────┼────────────────────────────┤ │
│ │ Newtonsoft.Json │ 13.0.2-beta2 │ Updated from 12.0.1 in Foo │ │
│ │ Newtonsoft.Json │ 13.0.2-beta2 │ Updated from 13.0.1 in Foo │ │
│ └─────────────────┴──────────────┴────────────────────────────┘ │
╰─────────────────────────────────────────────────────────────────╯
4 changes: 2 additions & 2 deletions src/Snitch.Tests/Expectations/Solution.Default.verified.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ Analyzing Thuuud...
│ ┌──────────────────┬──────────┬───────────────────────────────┐ │
│ │ Package │ Version │ Reason │ │
│ ├──────────────────┼──────────┼───────────────────────────────┤ │
│ │ Newtonsoft.Json │ 12.0.3 │ Updated from 12.0.1 in Foo │ │
│ │ Newtonsoft.Json │ 13.0.3 │ Updated from 13.0.1 in Foo │ │
│ │ Autofac │ 4.9.3 │ Downgraded from 4.9.4 in Foo │ │
│ └──────────────────┴──────────┴───────────────────────────────┘ │
│ │
│ Packages that might be removed from Thuuud: │
│ ┌─────────────────┬──────────────┬────────────────────────────┐ │
│ │ Package │ Version │ Reason │ │
│ ├─────────────────┼──────────────┼────────────────────────────┤ │
│ │ Newtonsoft.Json │ 13.0.2-beta2 │ Updated from 12.0.1 in Foo │ │
│ │ Newtonsoft.Json │ 13.0.2-beta2 │ Updated from 13.0.1 in Foo │ │
│ └─────────────────┴──────────────┴────────────────────────────┘ │
╰─────────────────────────────────────────────────────────────────╯
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Analyzing Thuuud...
│ ┌─────────────────┬──────────────┬────────────────────────────┐ │
│ │ Package │ Version │ Reason │ │
│ ├─────────────────┼──────────────┼────────────────────────────┤ │
│ │ Newtonsoft.Json │ 13.0.2-beta2 │ Updated from 12.0.1 in Foo │ │
│ │ Newtonsoft.Json │ 13.0.2-beta2 │ Updated from 13.0.1 in Foo │ │
│ └─────────────────┴──────────────┴────────────────────────────┘ │
│ │
│ Projects with pre-release package references: │
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Analyzing Thuuud...
│ ┌─────────────────┬──────────────┬────────────────────────────┐ │
│ │ Package │ Version │ Reason │ │
│ ├─────────────────┼──────────────┼────────────────────────────┤ │
│ │ Newtonsoft.Json │ 13.0.2-beta2 │ Updated from 12.0.1 in Foo │ │
│ │ Newtonsoft.Json │ 13.0.2-beta2 │ Updated from 13.0.1 in Foo │ │
│ └─────────────────┴──────────────┴────────────────────────────┘ │
│ │
│ Projects with pre-release package references: │
Expand Down
2 changes: 1 addition & 1 deletion src/Snitch.Tests/Snitch.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>

Expand Down
4 changes: 3 additions & 1 deletion src/Snitch/Analysis/ProjectBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.IO;
using System.Linq;
using Buildalyzer;
using Buildalyzer.IO;
using NuGet.Frameworks;
using NuGet.ProjectModel;
using Snitch.Analysis.Utilities;
Expand Down Expand Up @@ -234,7 +235,8 @@ private static Dictionary<string, string> GetRestoredVersions(string? lockFilePa

_console.MarkupLine(status);

var projectAnalyzer = manager.GetProject(project.Path);
var projectAnalyzer = manager.GetProject(IOPath.Parse(project.Path))
?? throw new InvalidOperationException($"Could not load the project '{project.Path}'.");
var results = (IEnumerable<IAnalyzerResult>)projectAnalyzer.Build();

project.IsMultiTargeting = results
Expand Down
13 changes: 8 additions & 5 deletions src/Snitch/Snitch.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<LangVersion>10.0</LangVersion>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<NoWarn>1701;1702;SA0001</NoWarn>
<Nullable>enable</Nullable>
<PackAsTool>true</PackAsTool>
Expand All @@ -23,11 +23,14 @@
<!-- Packages -->
<ItemGroup>
<PackageReference Include="Autofac" Version="7.1.0" />
<PackageReference Include="Buildalyzer" Version="5.0.1" />
<PackageReference Include="NuGet.Frameworks" Version="6.0.0" />
<PackageReference Include="NuGet.ProjectModel" Version="6.0.0" />
<PackageReference Include="NuGet.Versioning" Version="6.0.0" />
<PackageReference Include="Buildalyzer" Version="9.0.0" />
<PackageReference Include="NuGet.Frameworks" Version="7.9.0" />
<PackageReference Include="NuGet.ProjectModel" Version="7.9.0" />
<PackageReference Include="NuGet.Versioning" Version="7.9.0" />
<PackageReference Include="Spectre.Console.Cli" Version="0.47.0" />
<!-- Pinned above the versions Buildalyzer pulls in transitively, which have known vulnerabilities. -->
<PackageReference Include="System.Security.Cryptography.Pkcs" Version="10.0.13" />
<PackageReference Include="System.Security.Cryptography.Xml" Version="10.0.13" />
</ItemGroup>

<!-- Static analysis -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ private static string GetNearestFrameworkMoniker(this NuGetFramework framework,

var mappings = new Dictionary<NuGetFramework, string>(
candidates.ToDictionary(
x => NuGetFramework.Parse(x, provider), y => y, new NuGetFrameworkFullComparer()));
x => NuGetFramework.Parse(x, provider), y => y, NuGetFrameworkFullComparer.Instance));

var nearest = reducer.GetNearest(framework, mappings.Keys);
if (nearest == null)
Expand Down