Skip to content

Commit

Permalink
Bump SonarAnalyzer.CSharp from 9.31.0.96804 to 9.32.0.97167 (#183)
Browse files Browse the repository at this point in the history
Bumps
[SonarAnalyzer.CSharp](https://github.com/SonarSource/sonar-dotnet) from
9.31.0.96804 to 9.32.0.97167.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/SonarSource/sonar-dotnet/releases">SonarAnalyzer.CSharp's
releases</a>.</em></p>
<blockquote>
<h2>9.32</h2>
<p>This rule includes the promotion of 4 rules to Sonar-way, the
deprecation of 1 rule and 2 FP fixes.</p>
<h3>Rule Promotions and Deprecations</h3>
<ul>
<li><a
href="https://redirect.github.com/SonarSource/sonar-dotnet/issues/9644">9644</a>
- Modify S2387: Deprecate rule</li>
<li><a
href="https://redirect.github.com/SonarSource/sonar-dotnet/issues/9643">9643</a>
- Modify S4050: Promote to Sonar-way</li>
<li><a
href="https://redirect.github.com/SonarSource/sonar-dotnet/issues/9642">9642</a>
- Modify S2674: Promote to Sonar-way</li>
<li><a
href="https://redirect.github.com/SonarSource/sonar-dotnet/issues/9641">9641</a>
- Modify S3993: Promote to Sonar-way</li>
<li><a
href="https://redirect.github.com/SonarSource/sonar-dotnet/issues/9640">9640</a>
- Modify S4052: Promote to Sonar-way</li>
</ul>
<h3>False Positive</h3>
<ul>
<li><a
href="https://redirect.github.com/SonarSource/sonar-dotnet/issues/9590">9590</a>
- [C#] Fix S6966 FP: EntityFrameworks IDbContextFactory CreateDbContext
method is preferred over its Async counterpart</li>
<li><a
href="https://redirect.github.com/SonarSource/sonar-dotnet/issues/8300">8300</a>
- [C#] Fix S3431 FP: Don't raise if assertions are done in catch or
finally</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/SonarSource/sonar-dotnet/commit/cc0ba76c09677fe094621d35ab0c408bd1215aaa"><code>cc0ba76</code></a>
Update RSPEC before 9.32 release (<a
href="https://redirect.github.com/SonarSource/sonar-dotnet/issues/9633">#9633</a>)</li>
<li><a
href="https://github.com/SonarSource/sonar-dotnet/commit/5dd20a037ba741de5e400510e3e1e7a986b6794e"><code>5dd20a0</code></a>
Fix Java ITs (<a
href="https://redirect.github.com/SonarSource/sonar-dotnet/issues/9635">#9635</a>)</li>
<li><a
href="https://github.com/SonarSource/sonar-dotnet/commit/32d4351d6d07448da54365a5458a991c901dac64"><code>32d4351</code></a>
Repro for S2077: Ternary in formatted string (<a
href="https://redirect.github.com/SonarSource/sonar-dotnet/issues/9623">#9623</a>)</li>
<li><a
href="https://github.com/SonarSource/sonar-dotnet/commit/b9e9573bc3d222e5b3a14e049bac2d27935380a4"><code>b9e9573</code></a>
Update RSPEC before 9.32 release (<a
href="https://redirect.github.com/SonarSource/sonar-dotnet/issues/9632">#9632</a>)</li>
<li><a
href="https://github.com/SonarSource/sonar-dotnet/commit/1a49bd349598dc1b85d7f399d5ec3821d70bf1ce"><code>1a49bd3</code></a>
S4050: Promote to SonarWay (<a
href="https://redirect.github.com/SonarSource/sonar-dotnet/issues/9630">#9630</a>)</li>
<li><a
href="https://github.com/SonarSource/sonar-dotnet/commit/30a38e7e60fcfdaba69ad82f10e8f9d84859ae49"><code>30a38e7</code></a>
Increase threshold of flaky UT (<a
href="https://redirect.github.com/SonarSource/sonar-dotnet/issues/9631">#9631</a>)</li>
<li><a
href="https://github.com/SonarSource/sonar-dotnet/commit/abd975ca61b78e0ec88548321cf0720c2b3f3b30"><code>abd975c</code></a>
S3431: Optimize rule (<a
href="https://redirect.github.com/SonarSource/sonar-dotnet/issues/9627">#9627</a>)</li>
<li><a
href="https://github.com/SonarSource/sonar-dotnet/commit/ca7bacd54846f99a3b2c430fb3c9ba802ba58718"><code>ca7bacd</code></a>
Modify S4052: Promote to Sonar-way (<a
href="https://redirect.github.com/SonarSource/sonar-dotnet/issues/9629">#9629</a>)</li>
<li><a
href="https://github.com/SonarSource/sonar-dotnet/commit/6ffc193e4c0709cad5d007fb578e2c053d8f2ece"><code>6ffc193</code></a>
Modify S3993: Promote C# rule to Sonar-way (<a
href="https://redirect.github.com/SonarSource/sonar-dotnet/issues/9626">#9626</a>)</li>
<li><a
href="https://github.com/SonarSource/sonar-dotnet/commit/593fc71e98ca3c54880df9ef086f4bd72698a065"><code>593fc71</code></a>
ShimLayer: Synchonize OperationLightupGenerator with StyleCop (<a
href="https://redirect.github.com/SonarSource/sonar-dotnet/issues/9628">#9628</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/SonarSource/sonar-dotnet/compare/9.31.0.96804...9.32.0.97167">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=SonarAnalyzer.CSharp&package-manager=nuget&previous-version=9.31.0.96804&new-version=9.32.0.97167)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
Dependabot will merge this PR once CI passes on it, as requested by
@rjmurillo.

[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Matt Kotsenas <[email protected]>
Co-authored-by: Richard Murillo <[email protected]>
  • Loading branch information
3 people authored Aug 26, 2024
1 parent 5703f4e commit 0bccdf6
Show file tree
Hide file tree
Showing 10 changed files with 53 additions and 46 deletions.
3 changes: 3 additions & 0 deletions build/scripts/Set-SquiggleCopBaseline.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Get-ChildItem *.csproj -recurse -File | ForEach-Object{
dotnet clean $_.FullName && dotnet build $_.FullName /p:PedanticMode=true /p:SquiggleCop_AutoBaseline=true
}
2 changes: 1 addition & 1 deletion build/targets/codeanalysis/Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4" />
<PackageVersion Include="Roslynator.Analyzers" Version="4.12.4" />
<PackageVersion Include="StyleCop.Analyzers" Version="1.2.0-beta.556" />
<PackageVersion Include="SonarAnalyzer.CSharp" Version="9.31.0.96804" />
<PackageVersion Include="SonarAnalyzer.CSharp" Version="9.32.0.97167" />
<PackageVersion Include="SquiggleCop.Tasks" Version="1.0.26" />
<PackageVersion Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.11.20" />
<PackageVersion Include="ExhaustiveMatching.Analyzer" Version="0.5.0" />
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "8.0.303",
"version": "8.0.400",
"rollForward": "disable"
},
"msbuild-sdks": {
Expand Down
4 changes: 2 additions & 2 deletions src/Moq.Analyzers/AsShouldBeUsedOnlyForInterfaceAnalyzer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public override void Initialize(AnalysisContext context)
context.RegisterCompilationStartAction(RegisterCompilationStartAction);
}

private void RegisterCompilationStartAction(CompilationStartAnalysisContext context)
private static void RegisterCompilationStartAction(CompilationStartAnalysisContext context)
{
// Ensure Moq is referenced in the compilation
ImmutableArray<INamedTypeSymbol> mockTypes = context.Compilation.GetMoqMock();
Expand All @@ -58,7 +58,7 @@ private void RegisterCompilationStartAction(CompilationStartAnalysisContext cont
OperationKind.Invocation);
}

private void Analyze(OperationAnalysisContext context, ImmutableArray<IMethodSymbol> wellKnownAsMethods)
private static void Analyze(OperationAnalysisContext context, ImmutableArray<IMethodSymbol> wellKnownAsMethods)
{
if (context.Operation is not IInvocationOperation invocationOperation)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
}

[System.Diagnostics.CodeAnalysis.SuppressMessage("Maintainability", "AV1500:Member or local function contains too many statements", Justification = "Tracked in https://github.com/rjmurillo/moq.analyzers/issues/90")]
private async Task<Document> FixCallbackSignatureAsync(SyntaxNode root, Document document, ParameterListSyntax? oldParameters, CancellationToken cancellationToken)
private static async Task<Document> FixCallbackSignatureAsync(SyntaxNode root, Document document, ParameterListSyntax? oldParameters, CancellationToken cancellationToken)
{
SemanticModel? semanticModel = await document.GetSemanticModelAsync(cancellationToken).ConfigureAwait(false);

Expand Down
16 changes: 8 additions & 8 deletions src/Moq.Analyzers/ConstructorArgumentsShouldMatchAnalyzer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ private static void VerifyInterfaceMockAttempt(
}
}

private void AnalyzeCompilation(CompilationStartAnalysisContext context)
private static void AnalyzeCompilation(CompilationStartAnalysisContext context)
{
context.CancellationToken.ThrowIfCancellationRequested();

Expand All @@ -191,7 +191,7 @@ private void AnalyzeCompilation(CompilationStartAnalysisContext context)
context.RegisterSyntaxNodeAction(AnalyzeInstanceCall, SyntaxKind.InvocationExpression);
}

private void AnalyzeInstanceCall(SyntaxNodeAnalysisContext context)
private static void AnalyzeInstanceCall(SyntaxNodeAnalysisContext context)
{
InvocationExpressionSyntax invocationExpressionSyntax = (InvocationExpressionSyntax)context.Node;

Expand Down Expand Up @@ -220,7 +220,7 @@ private void AnalyzeInstanceCall(SyntaxNodeAnalysisContext context)
}
}

private void AnalyzeInvocation(
private static void AnalyzeInvocation(
SyntaxNodeAnalysisContext context,
InvocationExpressionSyntax invocationExpressionSyntax,
string expectedClassName,
Expand Down Expand Up @@ -273,7 +273,7 @@ private void AnalyzeInvocation(
/// match an existing constructor of the mocked class.
/// </summary>
/// <param name="context">The context.</param>
private void AnalyzeNewObject(SyntaxNodeAnalysisContext context)
private static void AnalyzeNewObject(SyntaxNodeAnalysisContext context)
{
ObjectCreationExpressionSyntax newExpression = (ObjectCreationExpressionSyntax)context.Node;

Expand Down Expand Up @@ -321,7 +321,7 @@ private void AnalyzeNewObject(SyntaxNodeAnalysisContext context)
/// <returns><c>true</c> if a suitable constructor was found; otherwise <c>false</c>. </returns>
/// <remarks>Handles <see langword="params" /> and optional parameters.</remarks>
[SuppressMessage("Design", "MA0051:Method is too long", Justification = "This should be refactored; suppressing for now to enable TreatWarningsAsErrors in CI.")]
private bool AnyConstructorsFound(
private static bool AnyConstructorsFound(
ImmutableArray<IMethodSymbol> constructors,
ImmutableArray<ArgumentSyntax> arguments,
SyntaxNodeAnalysisContext context)
Expand Down Expand Up @@ -400,7 +400,7 @@ private bool AnyConstructorsFound(
return false;
}

private (bool IsEmpty, Location Location) ConstructorIsEmpty(
private static (bool IsEmpty, Location Location) ConstructorIsEmpty(
ImmutableArray<IMethodSymbol> constructors,
ArgumentListSyntax? argumentList,
SyntaxNodeAnalysisContext context)
Expand All @@ -419,7 +419,7 @@ private bool AnyConstructorsFound(
return (constructors.IsEmpty, location);
}

private void VerifyMockAttempt(
private static void VerifyMockAttempt(
SyntaxNodeAnalysisContext context,
ITypeSymbol mockedClass,
ArgumentListSyntax? argumentList,
Expand Down Expand Up @@ -459,7 +459,7 @@ private void VerifyMockAttempt(
}
}

private void VerifyClassMockAttempt(
private static void VerifyClassMockAttempt(
SyntaxNodeAnalysisContext context,
ITypeSymbol mockedClass,
ArgumentListSyntax? argumentList,
Expand Down
Loading

0 comments on commit 0bccdf6

Please sign in to comment.