Skip to content

C#: Improve precision of cs/uncontrolled-format-string. #19271

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

Draft
wants to merge 21 commits into
base: main
Choose a base branch
from

Conversation

michaelnebel
Copy link
Contributor

@michaelnebel michaelnebel commented Apr 10, 2025

This is a follow up of #19148

In this PR we

  • Re-factor tests to use the inline expectations framework.
  • Remove the hasInsertions check. This can be removed as methods like Console.WriteLine(string) are no longer considered potential format calls (this was fixed in C#: Improve cs/invalid-string-formatting and add to the Code Quality suite. #19148).
  • Add support for CompositeFormat.Parse as this can cause runtime crashes when provided with an invalid format string.

DCA doesn't report any changes to performance or alerts.

@michaelnebel michaelnebel force-pushed the csharp/uncontrolled-format-string branch from 385674a to 2118c8e Compare April 10, 2025 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant