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

SA1217 reporting incorrect order if System.* is placed alphabetically #3809

Open
DavidArno opened this issue Feb 26, 2024 · 3 comments
Open

Comments

@DavidArno
Copy link

Version used: 1.2.0-beta.556

SA1217 fires incorrectly when the following items are placed alphabetically and doesn't fire if System.Convert is specified first:

using static Absolutes.PushContentType;
using static System.Convert;
@bjornhellander
Copy link
Contributor

bjornhellander commented Feb 26, 2024

I can't investigate this further right now, but I think that SA1217 is affected by the systemUsingDirectivesFirst configuration, which is true by default. This would make the behavior you're seeing by design. I see that the Configuration.md page doesn't mention SA1217, though.

@bjornhellander
Copy link
Contributor

Just tried it and it was as I wrote: SA1217 is affected by the systemUsingDirectivesFirst setting. Can I assume that it is not set to false in your stylecop.json file? If so, then what you report is the expected behavior. If you don't want this behavior, then you can set it to false, but that will affect non-static using statements as well.

@bjornhellander
Copy link
Contributor

The Configuration.md documentation page does however not mention that SA1210 and SA1217 are affected by the systemUsingDirectivesFirst setting. This seems like an oversight.

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

No branches or pull requests

2 participants