-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Enable CA18XX rules with suggestion severity #13924
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
0054af1 to
5ffa4c4
Compare
* CA1821: Remove empty Finalizers * CA1824: Mark assemblies with NeutralResourcesLanguageAttribute * CA1826: Do not use Enumerable methods on indexable collections * CA1828: Do not use CountAsync() or LongCountAsync() when AnyAsync() can be used * CA1832: Use AsSpan or AsMemory instead of Range-based indexers when appropriate * CA1833: Use AsSpan or AsMemory instead of Range-based indexers when appropriate
|
I suppose our goal is to make the existing codebase modern. If there is no code that falls under these rules, we can save time and leave the default values for such rules. Moreover, the default value is "suggestion" so we will see these recommendations anyway. |
By setting these rules to We cannot rely on |
|
I mean today (before next milestone start) we can fix many style and formatting issues with small commits and postpone a rest of the work. |
@iSazonov OK, I see your point. For future PRs I can focus on style and formatting issues. We may as well merge this PR though. |
|
@xtqqczze can you please tell if my understanding is correct:
Thank you. |
Correct, with
Correct, there no existing violations of these rules.
The rules were chosen from the CA18XX range that were already at |
It is a best practice from .Net team and forcing these rules helps us to avoid bad patterns. If there is any edge cases, we can always suppress these rules locally with the directive. |
Promote CA18XX rules with suggestion severity to warning:
Criteria used to select rules for this PR: