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

Bump SonarAnalyzer.CSharp from 9.31.0.96804 to 9.32.0.97167 #183

Merged
merged 6 commits into from
Aug 26, 2024
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
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
Loading