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] Resolve CA1507 for exception formatting arguments #10379

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

Conversation

h3xds1nz
Copy link
Member

@h3xds1nz h3xds1nz commented Jan 31, 2025

Contributes to #10270

Description

This resolves CA1507 occurences after forcefully triggering UseNameofInPlaceOfStringAnalyzer against the SR.Format methods. This replaces literals with nameof for parameters and properties, nothing else.

Unfortunately it is not possible to trigger the analyzer against explicit interface implementations (e.g. properties), so that will have to be done manually or via analyzer modification. Likewise, type name references are not resolved in this PR.

Customer Impact

Increased code maintainability and resilience against refactorings.

Regression

No.

Testing

Local build.

Risk

Low.

Microsoft Reviewers: Open in CodeFlow

@h3xds1nz h3xds1nz requested review from a team as code owners January 31, 2025 17:02
@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 Jan 31, 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.

1 participant