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 src/NuGetLicense/NuGetLicense.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net472'">
<PackageReference Include="System.IO.Hashing" Version="10.0.3" />
<PackageReference Include="System.Collections.Immutable" Version="10.0.3" />
<PackageReference Include="System.IO.Hashing" Version="10.0.5" />
<PackageReference Include="System.Collections.Immutable" Version="10.0.5" />
<PackageReference Include="PolySharp" Version="1.15.*">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
6 changes: 3 additions & 3 deletions src/NuGetUtility/NuGetUtility.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Remove the hidden BOM character at file start.

Line 1 contains a BOM/hidden character before <Project>, which is best removed to avoid unnecessary diff noise.

Suggested cleanup
-<Project Sdk="Microsoft.NET.Sdk">
+<Project Sdk="Microsoft.NET.Sdk">
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/NuGetUtility/NuGetUtility.csproj` at line 1, Remove the hidden BOM
character at the start of the file so the opening Project element reads exactly
"<Project Sdk=\"Microsoft.NET.Sdk\">"; open the NuGetUtility.csproj in a text
editor that can show/strip BOM (or re-save as UTF-8 without BOM) and ensure the
first character is '<' with no invisible bytes before the Project element to
prevent spurious diffs.


<PropertyGroup>
<TargetFrameworks>net472;net8.0;net9.0;net10.0</TargetFrameworks>
Expand Down Expand Up @@ -39,8 +39,8 @@
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net472'">
<PackageReference Include="System.IO.Hashing" Version="10.0.3" />
<PackageReference Include="System.Collections.Immutable" Version="10.0.3" />
<PackageReference Include="System.IO.Hashing" Version="10.0.5" />
<PackageReference Include="System.Collections.Immutable" Version="10.0.5" />
<PackageReference Include="Microsoft.Build" ExcludeAssets="runtime" Version="18.*" />
<PackageReference Include="PolySharp" Version="1.15.*">
<PrivateAssets>all</PrivateAssets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,8 @@ public AssetsPackageDependencyReader(INuGetFrameworkUtility nuGetFrameworkUtilit
/// (<c>Dictionary&lt;string, HashSet&lt;string&gt;&gt;</c>).
/// Returns an empty dictionary when the assets file does not exist or cannot be read.
/// </returns>
/// <exception cref="ArgumentNullException">
/// Thrown when <paramref name="assetsPath"/> or <paramref name="normalizedTargetFramework"/> is <see langword="null"/>.
/// </exception>
public Dictionary<string, HashSet<string>> GetPackageDependenciesForTargetFramework(ILockFile lockFile, string normalizedTargetFramework)
{
if (normalizedTargetFramework is null)
{
throw new ArgumentNullException(nameof(normalizedTargetFramework));
}

try
{
return BuildDependencyMapFromAssetsFile(lockFile, normalizedTargetFramework);
Expand Down Expand Up @@ -90,14 +82,8 @@ private Dictionary<string, HashSet<string>> BuildDependencyMapFromAssetsFile(ILo
continue;
}

string? packageName = library.Name;
if (packageName is null)
{
continue;
}

string packageNameValue = packageName.Trim();
if (packageNameValue.Length == 0)
string packageNameValue = library.Name.Trim();
if (string.IsNullOrEmpty(packageNameValue))
{
continue;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.3.0" />
<PackageReference Include="NSubstitute" Version="5.3.0" />
<PackageReference Include="TUnit" Version="1.19.16" />
<PackageReference Include="TUnit" Version="1.19.57" />
<PackageReference Include="coverlet.collector" Version="8.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,18 +158,6 @@ public void GetInstalledPackages_Should_ThrowReferencedPackageReaderException_If
Assert.That(exception!.Message, Is.EqualTo($"Failed to validate project assets for project {_projectPath}"));
}

[Test]
public void GetInstalledPackages_Should_ThrowReferencedPackageReaderException_If_TargetsArrayIsNull(
[Values] bool includeTransitive)
{
_lockFileMock.Targets.Returns((IEnumerable<ILockFileTarget>?)null);

ReferencedPackageReaderException? exception = Assert.Throws<ReferencedPackageReaderException>(() =>
_uut.GetInstalledPackages(_projectPath, includeTransitive));

Assert.That(exception!.Message, Is.EqualTo($"Failed to validate project assets for project {_projectPath}"));
}

[Test]
public void
GetInstalledPackages_Should_ThrowReferencedPackageReaderException_If_TargetsArrayDoesNotContainAnyElement(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.3.0" />
<PackageReference Include="NSubstitute" Version="5.3.0" />
<PackageReference Include="TUnit" Version="1.19.16" />
<PackageReference Include="TUnit" Version="1.19.57" />
<PackageReference Include="coverlet.collector" Version="8.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Remove the hidden BOM character at file start.

Line 1 includes a BOM/hidden character before <Project>, which can cause unnecessary churn in diffs and editor/tooling behavior.

Suggested cleanup
-<Project Sdk="Microsoft.NET.Sdk">
+<Project Sdk="Microsoft.NET.Sdk">
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@tests/targets/MultiTargetProjectWithDifferentDependencies/MultiTargetProjectWithDifferentDependencies.csproj`
at line 1, The file MultiTargetProjectWithDifferentDependencies.csproj contains
a hidden BOM character before the opening <Project> tag; remove the BOM by
re-saving the file as UTF-8 without BOM (or strip the leading invisible
character) so the file starts exactly with "<Project
Sdk=\"Microsoft.NET.Sdk\">", then commit the cleaned file to eliminate spurious
diffs and ensure tooling/CI treats the file normally.


<PropertyGroup>
<TargetFrameworks>net472;net9.0;net8.0-browser</TargetFrameworks>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
<PackageReference Include="TinyCsvParser" Version="3.0.0" />
<PackageReference Include="TinyCsvParser" Version="3.0.1" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0-browser'">
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="10.*" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="TinyCsvParser" Version="3.0.0" />
<PackageReference Include="TinyCsvParser" Version="3.0.1" />
</ItemGroup>

</Project>
Loading