-
Notifications
You must be signed in to change notification settings - Fork 470
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
Separate out CA1307 into two rules #4043
Conversation
Fixes dotnet#2581, again! 1. CA1310: Correctness rule that only flags string compare methods that are known to use culture specific string comparison by default 2. CA1307: Maintainability/Readability rule that flags the remainder methods that have an overload with an additional StringComparison parameter at the end. This rule does not care about the defaault string comparison used by the API.
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.
🚢
Codecov Report
@@ Coverage Diff @@
## master #4043 +/- ##
==========================================
- Coverage 95.63% 95.63% -0.01%
==========================================
Files 1156 1156
Lines 256670 256749 +79
Branches 15367 15370 +3
==========================================
+ Hits 245474 245549 +75
- Misses 9242 9243 +1
- Partials 1954 1957 +3 |
Thanks @dotpaul |
Filed https://github.com/MicrosoftDocs/visualstudio-docs/issues/5754 for adding docs. |
Doesn't this mean that CA1307 will now always fire on |
Yes, if you only care about correctness, you should disable CA1307 and just enable CA1310. CA1307 would most likely be used like a refactoring/hidden/suggestion available in IDE for users where they want to opportunistically keep moving to API overloads with StringComparison parameter. |
Looks good, thanks! |
Fixes #2581, again!
CA1310
: Correctness rule that only flags string compare methods that are known to use culture specific string comparison by defaultCA1307
: Maintainability/Readability rule that flags the remainder methods that have an overload with an additional StringComparison parameter at the end. This rule does not care about the default string comparison used by the API.