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] Addressing CA warnings Part 1 #10144

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

Conversation

himgoyalmicro
Copy link
Contributor

@himgoyalmicro himgoyalmicro commented Dec 5, 2024

Description

This work is a part of our initiative to set code-style guidelines, align WPF and WinForms, and ensure PR standards with respect to styles. This in turn will help us in better maintainability and readability of the repo overall. The changes follow up from the PR #10080 and references to the issue #10017.

The current changes address the following Errors/Warnings in the src folder of WPF:

  • CA2249: Consider using 'string.Contains' instead of 'string.IndexOf'
  • CA2251: Use String.Equals over String.Compare
  • CA1847: Use string.Contains(char) instead of string.Contains(string) with single characters
  • CA1845: Use span-based 'string.Concat'
  • CA1846: Prefer AsSpan over Substring

A good way to go about reviewing this is to go commit by commit which pans over individual errors/warnings and hence easing out the overall understanding.

Customer Impact

None

Regression

None

Testing

Local Build Pass
The current set of changes looks fairly mechanical and probably don't need a Test Pass, but these set of PRs can be clubbed to do so at a later stage.

Risk

Low

Microsoft Reviewers: Open in CodeFlow

@himgoyalmicro himgoyalmicro requested review from a team as code owners December 5, 2024 10:14
@dotnet-policy-service dotnet-policy-service bot added the PR metadata: Label to tag PRs, to facilitate with triage label Dec 5, 2024
@harshit7962
Copy link
Member

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR metadata: Label to tag PRs, to facilitate with triage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants