-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Re-Enable CA1416 #20477
Closed
Closed
Re-Enable CA1416 #20477
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jsuarezruiz
reviewed
Feb 12, 2024
stephen-hawley
suggested changes
Mar 27, 2024
In finishing up this PR, I found that there were 3 cases that I ran into:
|
github-actions
bot
force-pushed
the
reenable_CA1416
branch
2 times, most recently
from
May 21, 2024 16:16
a64b6b9
to
13f106e
Compare
/rebase |
github-actions
bot
force-pushed
the
reenable_CA1416
branch
from
May 22, 2024 22:00
13f106e
to
54538b1
Compare
/rebase |
PureWeen
added
the
area-infrastructure
CI, Maestro / Coherency, upstream dependencies/versions
label
May 31, 2024
This should take care of all the remaining CA1416 errors. Here's what I found about the analyzer for this - * It understands when code from Xamarin/macios is reachable from maui code and will flag an error * It never understands the pattern `if (!OperatingSystem.IsZZZZZZVersionAtLeast(major, minor)) return;` that implies that the rest of the code in the method is safe, flagging a false failure * Compound OS tests or complex code inside the test will flag a false failure * In the case of [this code](https://gist.github.com/stephen-hawley/716761d318fbcddd7795ed53d331cdc8), the analyzer appears to hang, although to be clear, I don't have evidence that it is the analyzer doing this In order to work around this, the simplest way is to refactor all the OS version specific code into its own method and flag it with `[SupportedOSPlatform("xxxyy.zz")]`. In this case, the above false failures go away. In rare cases, I was unable to do this and instead used a `#pragma` to suppress the warning around the code that triggered the false failure. I tried to avoid this at all costs since this is source of bugs waiting to happen.
stephen-hawley
previously approved these changes
Jun 24, 2024
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
Closing in favor of #26593 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
area-infrastructure
CI, Maestro / Coherency, upstream dependencies/versions
stale
Indicates a stale issue/pr and will be closed soon
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of Change
Issues Fixed
Fixes #