-
Notifications
You must be signed in to change notification settings - Fork 1.7k
C#: Improve cs/invalid-string-formatting
and add to the Code Quality suite.
#19148
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
Open
michaelnebel
wants to merge
16
commits into
github:main
Choose a base branch
from
michaelnebel:csharp/invalid-string-format
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
C#: Improve cs/invalid-string-formatting
and add to the Code Quality suite.
#19148
michaelnebel
wants to merge
16
commits into
github:main
from
michaelnebel:csharp/invalid-string-format
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cfe6cbd
to
286ae79
Compare
852eab9
to
e8f8145
Compare
DCA
|
51a03d2
to
be8d379
Compare
cs/invalid-string-formatting
and add to the codeql quality suite.
…tions and adjust some of the testcases.
…valid-string-format.
be8d379
to
5c6b1dd
Compare
cs/invalid-string-formatting
and add to the codeql quality suite.cs/invalid-string-formatting
and add to the Code Quality suite.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In this PR we
cs/invalid-string-formatting
to the code quality suite.Improve the
cs/invalid-string-formatting
query bystring.Format
where no additional arguments are provided (for instancestring.Format("{")
). Also start takingCompositeFormat
versions ofFormat
methods into account and considerSystem.Text.CompositeFormat.Parse
a method that parses format strings and might throw exceptions and cause a runtime crash.string.Format
andStringBuilder.AppendFormat
and also add support forMemoryExtensions.TryWrite
.Console.WriteLine(string)
and friends (methods that itsn't format methods).Review commit by commit is encouraged.
@hvitved : The data flow configurations are quite similar. Is it a better approach to use flow state to track calls to
CompositeFormat.Parse
? (instead of merging two similar graphs).