-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Handle CA1416 violations found in MAUI repo #6237
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
Conversation
src/Controls/src/Core/Platform/Android/ColorChangeRevealDrawable.cs
Outdated
Show resolved
Hide resolved
src/Controls/src/Core/Platform/Android/Extensions/BrushExtensions.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking really good and this is a long running PR with loads of changes. And a extra 👍 for the follow up issue.
I added a few comments that I think are API binding errors, s o maybe we should just ignore for now.
And then Shane's comment on the Debug.Assert. If there are things that will throw at runtime, then maybe we should actually not execute?
| #pragma warning disable CA1416 // TODO: 'UINavigationBar.PrefersLargeTitles' is only supported on: 'ios' 11.0 and later | ||
| bool CanUseRefreshControlProperty() => | ||
| this.GetNavigationController()?.NavigationBar?.PrefersLargeTitles ?? true; | ||
| #pragma warning restore CA1416 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this not just use a => IsAtLeast(11) && this.xxx.Prefers == true?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can do that, I was not sure because that could cause behavioral change, it is returning true if its null, which is strange
src/Core/src/ImageSources/UriImageSourceService/UriImageSourceService.iOS.cs
Outdated
Show resolved
Hide resolved
src/Controls/src/Core/Platform/Android/Extensions/ToolbarExtensions.cs
Outdated
Show resolved
Hide resolved
Thanks, suppressed with a link to the existing issues for iOS and Android
I have suppressed the |
Some of them got lost in dotnet#6237
Some of them got lost in dotnet#6237
…n (#6636) * Restore and fix tvOS checks and annotations Some of them got lost in dotnet/maui#6237 * Remove PlatformVersion and use OperatingSystem APIs directly
Fix Platform Compatibility Analyzer CA1416 violations found in MAUI repo
There is several issues found while evaluating the violations:
#pragma warning disable CA1416 // https://github.com/xamarin/xamarin-macios/issues/14619#pragma warning disable CA1416 // TODO: 'UIApplication.KeyWindow' is unsupported on: 'ios' 13.0 and later.System.Diagnostics.Debug.Assert(!OperatingSystem.IsIOSVersionAtLeast(14));#pragma warning disable CA1416 // Known false positive with Lambda expressionThe PR now ready for review
Fixes #823