Skip to content

Commit

Permalink
update to roslyn 4.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
pwelter34 committed Sep 7, 2024
1 parent 496b615 commit 87ee86b
Show file tree
Hide file tree
Showing 16 changed files with 66 additions and 31 deletions.
2 changes: 2 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ updates:
time: "02:00"
timezone: "America/Chicago"
open-pull-requests-limit: 10
ignore:
- dependency-name: "Microsoft.CodeAnalysis.CSharp"
groups:
Azure:
patterns:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ jobs:
github-token: "${{ secrets.GITHUB_TOKEN }}"

- name: Dependabot Auto-Merge PRs
if: steps.metadata.outputs.update-type == 'version-update:semver-patch'
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
Expand Down
3 changes: 2 additions & 1 deletion FluentCommand.sln
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
# 17
VisualStudioVersion = 17.3.32804.467
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FluentCommand", "src\FluentCommand\FluentCommand.csproj", "{4D5F125D-8DD5-496B-959E-78F55D8BE946}"
Expand All @@ -22,6 +22,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{38D98603
.github\dependabot.yml = .github\dependabot.yml
src\Directory.Build.props = src\Directory.Build.props
.github\workflows\dotnet.yml = .github\workflows\dotnet.yml
.github\workflows\merge.yml = .github\workflows\merge.yml
README.md = README.md
EndProjectSection
EndProject
Expand Down
4 changes: 2 additions & 2 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="AssemblyMetadata.Generators" Version="2.0.0" PrivateAssets="All" />
<PackageReference Include="MinVer" Version="5.0.0" PrivateAssets="All" />
<PackageReference Include="AssemblyMetadata.Generators" Version="2.1.0" PrivateAssets="All" />
<PackageReference Include="MinVer" Version="6.0.0" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
Expand Down
12 changes: 7 additions & 5 deletions src/FluentCommand.Generators/FluentCommand.Generators.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,24 @@

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<ImplicitUsings>true</ImplicitUsings>
<IncludeSymbols>false</IncludeSymbols>

<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>

<IsRoslynComponent>true</IsRoslynComponent>
<NoPackageAnalysis>true</NoPackageAnalysis>
<IncludeBuildOutput>false</IncludeBuildOutput>
<DevelopmentDependency>true</DevelopmentDependency>
<IsPackable>false</IsPackable>

<AnalyzerLanguage>cs</AnalyzerLanguage>
<AnalyzerRoslynVersion>4.3</AnalyzerRoslynVersion>
<LangVersion>latest</LangVersion>
<AnalyzerRoslynVersion>4.4</AnalyzerRoslynVersion>

<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="[4.3.1]" PrivateAssets="all" />
<!-- https://learn.microsoft.com/en-us/visualstudio/extensibility/roslyn-version-support -->
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="[4.4.0]" PrivateAssets="all" />
</ItemGroup>

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

<ItemGroup>
<PackageReference Include="MicroSoft.Data.SqlClient" Version="5.2.1" />
<PackageReference Include="MicroSoft.Data.SqlClient" Version="5.2.2" />
</ItemGroup>

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

<ItemGroup>
<None Include="..\FluentCommand.Generators\bin\$(Configuration)\netstandard2.0\FluentCommand.Generators.dll" PackagePath="analyzers\dotnet\roslyn4.3\cs" Pack="true" Visible="false" />
<None Include="..\FluentCommand.Generators\bin\$(Configuration)\netstandard2.0\FluentCommand.Generators.dll" PackagePath="analyzers\dotnet\roslyn4.4\cs" Pack="true" Visible="false" />
</ItemGroup>

</Project>
25 changes: 24 additions & 1 deletion src/FluentCommand/Internal/HashCode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public HashCode Combine<TValue>(TValue value)
var hashCode = value is null ? 0 : EqualityComparer<TValue>.Default.GetHashCode(value);
unchecked
{
hashCode = _hashCode * Multiplier + hashCode;
hashCode = (_hashCode * Multiplier) + hashCode;
}

return new HashCode(hashCode);
Expand Down Expand Up @@ -235,3 +235,26 @@ public static int HashString(string text)
return hash;
}
}


public class MyClass
{
public string Name { get; set; }

public Type Type { get; set; }

public override bool Equals(object obj)
{
return obj is MyClass @class &&
Name == @class.Name &&
EqualityComparer<Type>.Default.Equals(Type, @class.Type);
}

public override int GetHashCode()
{
int hashCode = -243844509;
hashCode = hashCode * -1521134295 + EqualityComparer<string>.Default.GetHashCode(Name);
hashCode = hashCode * -1521134295 + EqualityComparer<Type>.Default.GetHashCode(Type);
return hashCode;
}
}
4 changes: 1 addition & 3 deletions test/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="AssemblyMetadata.Generators" Version="2.0.0" PrivateAssets="All" />
<PackageReference Include="Bogus" Version="35.6.0" />
<PackageReference Include="Bogus" Version="35.6.1" />
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="MinVer" Version="5.0.0" PrivateAssets="All" />
<PackageReference Include="XUnit.Hosting" Version="1.7.1" />
</ItemGroup>

Expand Down
14 changes: 14 additions & 0 deletions test/FluentCommand.Entities/StatusRecord.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,17 @@ public record StatusRecord(
[DataFieldConverter(typeof(ConcurrencyTokenHandler))]
ConcurrencyToken RowVersion
);

public record StatusRecordList(
int Id,
string Name,
string Description,
int DisplayOrder,
bool IsActive,
DateTimeOffset Created,
string CreatedBy,
DateTimeOffset Updated,
string UpdatedBy,
ConcurrencyToken RowVersion,
List<string> Versions
);
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
</PackageReference>
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="Verify.Xunit" Version="26.1.6" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="Verify.Xunit" Version="26.4.0" />
<PackageReference Include="xunit" Version="2.9.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,4 @@
<ProjectReference Include="..\FluentCommand.Entities\FluentCommand.Entities.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Update="XUnit.Hosting" Version="1.7.1" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.1" />
<PackageReference Include="Npgsql" Version="8.0.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="Testcontainers.Postgresql" Version="3.9.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="Testcontainers.Postgresql" Version="3.10.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<PackageReference Include="Microsoft.Data.Sqlite" Version="8.0.8" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.2.2" />
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="8.0.8" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="Testcontainers.Azurite" Version="3.9.0" />
<PackageReference Include="Testcontainers.MsSql" Version="3.9.0" />
<PackageReference Include="Testcontainers.Redis" Version="3.9.0" />
<PackageReference Include="Verify.Xunit" Version="26.1.6" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="Testcontainers.Azurite" Version="3.10.0" />
<PackageReference Include="Testcontainers.MsSql" Version="3.10.0" />
<PackageReference Include="Testcontainers.Redis" Version="3.10.0" />
<PackageReference Include="Verify.Xunit" Version="26.4.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
Expand Down
4 changes: 2 additions & 2 deletions test/FluentCommand.Tests/FluentCommand.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
</PackageReference>
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="Verify.Xunit" Version="26.1.6" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="Verify.Xunit" Version="26.4.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
Expand Down

0 comments on commit 87ee86b

Please sign in to comment.