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

Prepare for .NET8 analyzers #2228

Merged
merged 6 commits into from
Jun 23, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions Build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ void ReportTestOutcome(params string[] globFilters)
.Executes(() =>
{
ReportGenerator(s => s
.SetProcessToolPath(NuGetToolPathResolver .GetPackageExecutable("ReportGenerator", "ReportGenerator.dll", framework: "net6.0"))
.SetProcessToolPath(NuGetToolPathResolver.GetPackageExecutable("ReportGenerator", "ReportGenerator.dll", framework: "net6.0"))
.SetTargetDirectory(TestResultsDirectory / "reports")
.AddReports(TestResultsDirectory / "**/coverage.cobertura.xml")
.AddReportTypes(
Expand Down Expand Up @@ -301,7 +301,7 @@ void ReportTestOutcome(params string[] globFilters)

if (EnvironmentInfo.IsWin)
{
NSpec3( $"{Solution.TestFrameworks.NSpec3_Net47_Specs.Directory / "bin" / "Debug" / "net47" / "NSpec3.Specs.dll"}");
NSpec3($"{Solution.TestFrameworks.NSpec3_Net47_Specs.Directory / "bin" / "Debug" / "net47" / "NSpec3.Specs.dll"}");
}

ReportTestOutcome(projects.Select(p => $"*{p.Name}*.trx").ToArray());
Expand Down
2 changes: 1 addition & 1 deletion Src/FluentAssertions/Formatting/FormattedObjectGraph.cs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ internal record PossibleMultilineFragment
{
private readonly FormattedObjectGraph parentGraph;
private readonly int startingLineBuilderIndex;
private int startingLineCount;
private readonly int startingLineCount;

public PossibleMultilineFragment(FormattedObjectGraph parentGraph)
{
Expand Down
2 changes: 2 additions & 0 deletions Tests/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ dotnet_diagnostic.CA1822.severity = none
dotnet_diagnostic.CA1825.severity = none
# CA1852: A type that's not accessible outside its assembly and has no subtypes within its containing assembly is not marked sealed
dotnet_diagnostic.CA1852.severity = none
# CA1861: Avoid constant arrays as arguments
dotnet_diagnostic.CA1861.severity = none
# CA2000: Dispose objects before losing scope
dotnet_diagnostic.CA2000.severity = none
# CA2201: Exception type System.Exception is not sufficiently specific
Expand Down
2 changes: 2 additions & 0 deletions Tests/FluentAssertions.Specs/AssertionOptionsSpecs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@
{
When(() =>
{
#pragma warning disable CA1859 // https://github.com/dotnet/roslyn-analyzers/issues/6704
IEquivalencyAssertionOptions equivalencyAssertionOptions = new EquivalencyAssertionOptions();
#pragma warning restore CA1859

return () => Parallel.For(0, 10_000, new ParallelOptions { MaxDegreeOfParallelism = 8 },
_ => equivalencyAssertionOptions.GetEqualityStrategy(typeof(IEnumerable))
Expand Down Expand Up @@ -255,7 +257,7 @@

protected static EquivalencyPlan Plan
{
get { return AssertionOptions.EquivalencyPlan; }

Check notice on line 260 in Tests/FluentAssertions.Specs/AssertionOptionsSpecs.cs

View workflow job for this annotation

GitHub Actions / Qodana Scan

Use preferred body style (convert into property, indexer, or event with preferred body style)

Inconsistent body style: use expression-bodied property

Check notice on line 260 in Tests/FluentAssertions.Specs/AssertionOptionsSpecs.cs

View workflow job for this annotation

GitHub Actions / Qodana Scan

Use preferred body style (convert into property, indexer, or event with preferred body style)

Inconsistent body style: use expression-bodied property

Check notice on line 260 in Tests/FluentAssertions.Specs/AssertionOptionsSpecs.cs

View workflow job for this annotation

GitHub Actions / Qodana Scan

Use preferred body style (convert into property, indexer, or event with preferred body style)

Inconsistent body style: use expression-bodied property

Check notice on line 260 in Tests/FluentAssertions.Specs/AssertionOptionsSpecs.cs

View workflow job for this annotation

GitHub Actions / Qodana Scan

Use preferred body style (convert into property, indexer, or event with preferred body style)

Inconsistent body style: use expression-bodied property

Check notice on line 260 in Tests/FluentAssertions.Specs/AssertionOptionsSpecs.cs

View workflow job for this annotation

GitHub Actions / Qodana Scan

Use preferred body style (convert into property, indexer, or event with preferred body style)

Inconsistent body style: use expression-bodied property
}
}

Expand Down
4 changes: 2 additions & 2 deletions Tests/FluentAssertions.Specs/Execution/AssertionScopeSpecs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -307,9 +307,9 @@ public void ThrowIfAny(IDictionary<string, object> context)
}
}

#pragma warning disable RCS1110, CA1050 // Declare type inside namespace.
#pragma warning disable RCS1110, CA1050, S3903 // Declare type inside namespace.
public class AssertionScopeSpecsWithoutNamespace
#pragma warning restore RCS1110, CA1050 // Declare type inside namespace.
#pragma warning restore RCS1110, CA1050, S3903 // Declare type inside namespace.
{
[Fact]
public void This_class_should_not_be_inside_a_namespace()
Expand Down