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 SupportedOSPlatformGuard, UnsupportedOSPlatformGuard attributes #52028

Merged
merged 2 commits into from
May 3, 2021

Conversation

buyaa-n
Copy link
Contributor

@buyaa-n buyaa-n commented Apr 29, 2021

Fixes #51541
Add SupportedOSPlatformGuard and UnsupportedOSPlatformGuard attributes which can be applied to boolean Field, Property or Method and used as a custom guard for platform check functionality in flow analysis of Platform Compatibility Analyzer (CA1416) using.

See more from #51541

@dotnet-issue-labeler
Copy link

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

@@ -10334,21 +10334,11 @@ public sealed partial class FrameworkName : System.IEquatable<System.Runtime.Ver
public static bool operator !=(System.Runtime.Versioning.FrameworkName? left, System.Runtime.Versioning.FrameworkName? right) { throw null; }
public override string ToString() { throw null; }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Enum | System.AttributeTargets.Event | System.AttributeTargets.Field | System.AttributeTargets.Interface | System.AttributeTargets.Method | System.AttributeTargets.Module | System.AttributeTargets.Property | System.AttributeTargets.Struct, AllowMultiple = true, Inherited = false)]
public sealed class SupportedOSPlatformAttribute : System.Runtime.Versioning.OSPlatformAttribute
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Seems because of the renaming from MinimumOSPlatformAttribute => SupportedOSPlatformAttribute broke the alphabetical order, moved the API down, Same for RemovedOSPlatformAttribute => UnsupportedOSPlatformAttribute

Copy link
Member

@jeffhandley jeffhandley left a comment

Choose a reason for hiding this comment

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

Just saw 1 typo; otherwise looks good to me.

…ning/PlatformAttributes.cs

Co-authored-by: Jeff Handley <[email protected]>
@buyaa-n
Copy link
Contributor Author

buyaa-n commented May 3, 2021

The failures are unrelated and there is issues for tracking: #49105, #52031, merging

@buyaa-n buyaa-n merged commit e6bb456 into dotnet:main May 3, 2021
@buyaa-n buyaa-n deleted the platform_guard_attributes branch May 3, 2021 05:55
@karelz karelz added this to the 6.0.0 milestone May 20, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Jun 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add SupportedOSPlatformGuard and UnsupportedOSPlatformGuard Platform-Guard attributes
4 participants