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

[StyleCleanUp] Specify StringComparison for correctness (CA1310) #10704

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

h3xds1nz
Copy link
Member

@h3xds1nz h3xds1nz commented Apr 4, 2025

Fixes #10703

Description

Fixes culture-specific comparisons for compares that are not meant to be culture-specific (e.g. namespace names).

Customer Impact

Cleaner codebase for developers, deterministic output of some functions.

Regression

No.

Testing

Local build.

Risk

None but also medium (see self-review note).

Microsoft Reviewers: Open in CodeFlow

@h3xds1nz h3xds1nz requested review from a team as code owners April 4, 2025 08:38
@dotnet-policy-service dotnet-policy-service bot added PR metadata: Label to tag PRs, to facilitate with triage Community Contribution A label for all community Contributions labels Apr 4, 2025
{
return String.Compare(one.Key.ToString(), two.Key.ToString());
return string.Compare(one.Key.ToString(), two.Key.ToString(), StringComparison.Ordinal);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit I'm not sure about changing to Ordinal. I don't think it matters in this case but it's something to keep in mind during review.

Copy link

codecov bot commented Apr 4, 2025

Codecov Report

Attention: Patch coverage is 0% with 8 lines in your changes missing coverage. Please review.

Project coverage is 10.90897%. Comparing base (2ded801) to head (df06cef).
Report is 3 commits behind head on main.

Additional details and impacted files
@@                 Coverage Diff                 @@
##                main      #10704         +/-   ##
===================================================
- Coverage   10.95887%   10.90897%   -0.04990%     
===================================================
  Files           3310        3310                 
  Lines         664667      664664          -3     
  Branches       74667       74667                 
===================================================
- Hits           72840       72508        -332     
- Misses        590685      591024        +339     
+ Partials        1142        1132         -10     
Flag Coverage Δ
Debug 10.90897% <0.00000%> (-0.04990%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@siagupta0202 siagupta0202 self-assigned this Apr 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Community Contribution A label for all community Contributions PR metadata: Label to tag PRs, to facilitate with triage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CA1310: Specify StringComparison for correctness
2 participants