-
-
Notifications
You must be signed in to change notification settings - Fork 63
MA0011: Skip diagnostic for culture-invariant interpolated strings #919
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
Conversation
Co-authored-by: meziantou <[email protected]>
…ring check Co-authored-by: meziantou <[email protected]>
Co-authored-by: meziantou <[email protected]>
|
@copilot Look at the ci output and fix the error |
Fixed the file encoding issue in commit 9df0dfa. Both Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
9df0dfa to
8a8cfc7
Compare
|
@copilot I've updated the tests. |
…gContext Co-authored-by: meziantou <[email protected]>
Refactored in commit 409df3f. Reverted changes in UseIFormatProviderAnalyzer.cs and moved the interpolated string detection logic to CultureSensitiveFormattingContext.cs where it can be reused by other analyzers. The logic now checks if all interpolated string arguments (FormattableString or types with InterpolatedStringHandlerAttribute) are culture-invariant before reporting them as culture-sensitive. |
| if (typeSymbol.IsEqualTo(FormattableStringSymbol)) | ||
| return true; | ||
|
|
||
| if (typeSymbol.IsEqualTo(DefaultInterpolatedStringHandlerSymbol)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot Checking this type is useless. Checking the InterpolatedStringHandlerAttributeSymbol attribute here-after is enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed in commit b685ca8. The DefaultInterpolatedStringHandler check and symbol field have been removed since DefaultInterpolatedStringHandler has the InterpolatedStringHandlerAttribute, making the explicit check redundant.
Co-authored-by: meziantou <[email protected]>
8176922 to
c0ce4ba
Compare
Summary
Fixed MA0011 to skip reporting diagnostics when interpolated string arguments are culture-invariant.
Changes:
The logic now properly resides in CultureSensitiveFormattingContext where it can be reused by other analyzers.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.