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

Enable CA1863 (Use 'CompositeFormat') as suggestion #89029

Merged
merged 1 commit into from
Jul 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions eng/CodeAnalysis.src.globalconfig
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,9 @@ dotnet_diagnostic.CA1861.severity = warning
# CA1862: Prefer using 'StringComparer'/'StringComparison' to perform case-insensitive string comparisons
dotnet_diagnostic.CA1862.severity = warning

# CA1863: Use 'CompositeFormat'
dotnet_diagnostic.CA1863.severity = suggestion

# CA1864: Prefer the 'IDictionary.TryAdd(TKey, TValue)' method
dotnet_diagnostic.CA1864.severity = warning

Expand Down
3 changes: 3 additions & 0 deletions eng/CodeAnalysis.test.globalconfig
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,9 @@ dotnet_diagnostic.CA1861.severity = none
# CA1862: Prefer using 'StringComparer'/'StringComparison' to perform case-insensitive string comparisons
dotnet_diagnostic.CA1862.severity = none

# CA1863: Use 'CompositeFormat'
dotnet_diagnostic.CA1863.severity = none

# CA1864: Prefer the 'IDictionary.TryAdd(TKey, TValue)' method
dotnet_diagnostic.CA1864.severity = none

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1895,8 +1895,8 @@ internal FieldInfo GetField(RuntimeFieldHandleInternal field)
else if (!declaredType.IsAssignableFrom(reflectedType))
{
// declaredType is not Array, not generic, and not assignable from reflectedType
throw new ArgumentException(string.Format(
CultureInfo.CurrentCulture, SR.Argument_ResolveMethodHandle,
throw new ArgumentException(SR.Format(
SR.Argument_ResolveMethodHandle,
reflectedType.ToString(), declaredType.ToString()));
}
}
Expand Down