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

Add diagnostic suppressor for the MarkMethodsAsStatic diagnostics on custom marshallers #72129

Merged
merged 5 commits into from
Jul 15, 2022
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Add the suppression id to our diagnostic list markdown file. Disable …
…the test suite on Mono against an active issue
  • Loading branch information
jkoritzinsky committed Jul 14, 2022
commit c474b9c84f383fc6ea3948999d176188c53118a4
6 changes: 6 additions & 0 deletions docs/project/list-of-diagnostics.md
Original file line number Diff line number Diff line change
@@ -173,3 +173,9 @@ The diagnostic id values reserved for .NET Libraries analyzer warnings are `SYSL
| __`SYSLIB1062`__ | *_`SYSLIB1062`-`SYSLIB1064` reserved for Microsoft.Interop.LibraryImportGenerator._* |
| __`SYSLIB1063`__ | *_`SYSLIB1062`-`SYSLIB1064` reserved for Microsoft.Interop.LibraryImportGenerator._* |
| __`SYSLIB1064`__ | *_`SYSLIB1062`-`SYSLIB1064` reserved for Microsoft.Interop.LibraryImportGenerator._* |

### Diagnostic Suppressions (`SYSLIBSUPPRESS****`)

| Suppression ID | Suppressed Diagnostic ID | Description |
| :----------------- | :----------------------- | :---------- |
| __`SYSLIBSUPPRESS0001`__ | CA1822 | Do not offer to make methods static when the methods need to be instance methods for a custom marshaller shape. |
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ namespace Microsoft.Interop.Analyzers
[DiagnosticAnalyzer(LanguageNames.CSharp, LanguageNames.VisualBasic)]
public class ShapeBreakingDiagnosticSuppressor : DiagnosticSuppressor
{
public static readonly SuppressionDescriptor MarkMethodsAsStaticSuppression = new SuppressionDescriptor("SYSLIBSUPPRESS1001", "CA1822", "Do not offer to make methods static when they need to be instance methods.");
public static readonly SuppressionDescriptor MarkMethodsAsStaticSuppression = new SuppressionDescriptor("SYSLIBSUPPRESS0001", "CA1822", "Do not offer to make methods static when the methods need to be instance methods for a custom marshaller shape.");

public override ImmutableArray<SuppressionDescriptor> SupportedSuppressions =>
ImmutableArray.Create(MarkMethodsAsStaticSuppression);
Original file line number Diff line number Diff line change
@@ -17,6 +17,7 @@

namespace LibraryImportGenerator.Unit.Tests
{
[ActiveIssue("https://github.com/dotnet/runtime/issues/60650", TestRuntimes.Mono)]
public class ShapeBreakingDiagnosticSuppressorTests
{
[Fact]