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

Analyzers assume strict Xunit attributes, not derived ones #1963

Closed
kzu opened this issue Jun 13, 2019 · 2 comments
Closed

Analyzers assume strict Xunit attributes, not derived ones #1963

kzu opened this issue Jun 13, 2019 · 2 comments

Comments

@kzu
Copy link
Contributor

kzu commented Jun 13, 2019

If you create a custom (say) TheoryAttribute-derived class, the analyzers that check the presence of InlineData, verify that InlineData matches method parameters, etc., don't work since they check for the presence of the exact symbol. Since it's at the symbol analysis phase, it could check whether the attributes or any of its base types equals TheoryAttribute instead.

@bradwilson
Copy link
Member

After consideration and in concert with other issues, the general strategy is to only have analyzers apply in cases where we know with 100% certainty that the rules apply. This means that we generally don't run analyzers against 3rd party extensions since there's no way for us to know whether those extensions have changed the behavior in any meaningful way (and in fact, have had issues opened against our analyzers by third party libraries when we are overly aggressive about trying to enforce rules that may not be true when extensions are in use).

@bradwilson bradwilson closed this as not planned Won't fix, can't repro, duplicate, stale Nov 8, 2023
@kzu
Copy link
Contributor Author

kzu commented Dec 17, 2023

Ah, yeah, makes sense. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants