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 new analyzers CA1862, CA1864 in runtime and fix findings. #88700

Merged
merged 2 commits into from
Jul 14, 2023

Conversation

buyaa-n
Copy link
Contributor

@buyaa-n buyaa-n commented Jul 11, 2023

Enable new analyzers CA1862, CA1864 in runtime and fix findings.

  • Nothing flagged for CA1862: Prefer using 'StringComparer'/'StringComparison' to perform case-insensitive string comparisons
  • All updates related to CA1864: Prefer the 'IDictionary.TryAdd(TKey, TValue)' method, thanks to @CollinAlpert

@ghost
Copy link

ghost commented Jul 11, 2023

Tagging subscribers to this area: @dotnet/area-meta
See info in area-owners.md if you want to be subscribed.

Issue Details

Enable new analyzers CA1862, CA1864 in runtime and fix findings.

  • Nothing flagged for CA1862: Prefer using 'StringComparer'/'StringComparison' to perform case-insensitive string comparisons
  • All updates related to CA1864: Prefer the 'IDictionary.TryAdd(TKey, TValue)' method, thanks to @CollinAlpert
Author: buyaa-n
Assignees: -
Labels:

area-Meta

Milestone: -

@@ -577,9 +577,11 @@ private void ApplyPublishProperties(ITaskItem newAsemblyAsset)

foreach (var candidate in resolvedFilesToPublish)
{
#pragma warning disable CA1864 // Prefer the 'IDictionary.TryAdd(TKey, TValue)' method. Dictionary.TryAdd() not available in .Net framework.
Copy link
Contributor Author

@buyaa-n buyaa-n Jul 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might want to if-def .Net framework build and apply the fix

Copy link
Member

@carlossanlop carlossanlop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for enabling it. I am not expecting any hits from CA1862 in the runtime repo.

@buyaa-n
Copy link
Contributor Author

buyaa-n commented Jul 14, 2023

All failures are unrelated and known

@buyaa-n buyaa-n merged commit 9409e2d into dotnet:main Jul 14, 2023
153 of 180 checks passed
@buyaa-n buyaa-n deleted the enable-ca1864 branch July 14, 2023 02:57
@ghost ghost locked as resolved and limited conversation to collaborators Aug 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants