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

Suppress incorrect "CA1822:Mark members as static" analyzer violation in ShapeProxyBenchmark (Lombiq Technologies: OCORE-156) #15707

Merged
merged 1 commit into from
Apr 9, 2024
Merged
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
5 changes: 5 additions & 0 deletions test/OrchardCore.Benchmarks/ShapeProxyBenchmark.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Concurrent;
using System.Diagnostics.CodeAnalysis;
using BenchmarkDotNet.Attributes;
using Castle.DynamicProxy;
using OrchardCore.ContentManagement.Display.ViewModels;
Expand All @@ -19,6 +20,10 @@ namespace OrchardCore.Benchmark

[MemoryDiagnoser]
[ShortRunJob]
[SuppressMessage(
"Performance",
"CA1822:Mark members as static",
Justification = "BenchmarkDotNet needs all benchmark methods to be instance-level.")]
Comment on lines +23 to +26
Copy link
Member Author

Choose a reason for hiding this comment

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

I didn't add this to the whole project in the end, because these are best when they're as narrow as possible, and there's no other instance of this in the project.

public class ShapeProxyBenchmark
{
private static ConcurrentDictionary<Type, Type> _proxyTypesCache = [];
Expand Down
Loading