Skip to content

Conversation

@martincostello
Copy link
Member

  • Replace ToArray() and ToList() calls with collection expressions, where relevant.
  • Make a few lambdas static.
  • Add "Simmy" to the custom dictionary for the Visual Studio spellchecker.
  • Use primary constructor in GeneratorHelper.
  • Tidy up formatting of parameters.

Replace `ToArray()` and `ToList()` calls with collection expressions, where relevant.
Make a few delegates static.
Add "Simmy" to the custom dictionary for the Visual Studio spellchecker.
Use primary constructor in `GeneratorHelper`.
Tidy up formatting of parameters.
@Copilot Copilot AI review requested due to automatic review settings August 22, 2025 13:14
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR modernizes the codebase by replacing ToArray() and ToList() calls with collection expressions where applicable, updates some lambdas to be static, adds "Simmy" to the Visual Studio spellchecker dictionary, converts GeneratorHelper to use a primary constructor, and improves parameter formatting.

  • Replaced LINQ method calls with collection expressions using the spread operator ([..])
  • Made lambdas static where they don't capture variables
  • Updated GeneratorHelper to use primary constructor syntax
  • Improved code formatting for method parameters

Reviewed Changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
test/Polly.Specs/Wrap/IPolicyWrapExtensionSpecs.cs Replace ToList() with collection expression
test/Polly.Specs/Helpers/PolicyTResultExtensionsAsync.cs Format parameters and replace formatting
test/Polly.Specs/Helpers/PolicyTResultExtensions.cs Improve parameter formatting
test/Polly.Specs/Helpers/ContextualPolicyTResultExtensions.cs Format method parameters
test/Polly.Extensions.Tests/Telemetry/TelemetryListenerImplTests.cs Replace ToList() with collection expressions
test/Polly.Core.Tests/Retry/RetryHelperTests.cs Replace ToArray() with collection expression
test/Polly.Core.Tests/ResiliencePipelineTests.cs Replace ToArray() with collection expression
src/Snippets/Docs/Retry.cs Replace ToImmutableArray() with collection expression
src/Polly/Wrap/ISyncPolicyPolicyWrapExtensions.cs Replace ToArray() with collection expression
src/Polly/Wrap/IAsyncPolicyPolicyWrapExtensions.cs Replace ToArray() with collection expressions
src/Polly.Testing/ResiliencePipelineExtensions.cs Make lambda static
src/Polly.Extensions/Telemetry/TelemetryUtil.cs Replace ToArray() with collection expression
src/Polly.Extensions/Telemetry/TelemetryOptions.cs Replace ToList() with collection expressions
src/Polly.Extensions/Telemetry/TelemetryListenerImpl.cs Replace ToList() with collection expressions
src/Polly.Core/Utils/Pipeline/CompositeComponent.cs Replace ToList() with array expression and make lambda static
src/Polly.Core/Simmy/Utils/GeneratorHelper.cs Convert to primary constructor
src/Polly.Core/CircuitBreaker/CircuitBreakerManualControl.cs Replace ToArray() with collection expressions
exclusion.dic Add "simmy" to spellchecker dictionary
bench/Polly.Core.Benchmarks/Utils/Helper.StrategyPipeline.cs Replace ToArray() with collection expression and make lambda static

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@martincostello martincostello enabled auto-merge (rebase) August 22, 2025 13:14
@codecov
Copy link

codecov bot commented Aug 22, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.12%. Comparing base (155c22e) to head (8e32954).
⚠️ Report is 5 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2715   +/-   ##
=======================================
  Coverage   96.12%   96.12%           
=======================================
  Files         309      309           
  Lines        7118     7118           
  Branches     1006     1008    +2     
=======================================
  Hits         6842     6842           
  Misses        222      222           
  Partials       54       54           
Flag Coverage Δ
linux 96.12% <100.00%> (ø)
macos 96.12% <100.00%> (ø)
windows 96.11% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@martincostello martincostello merged commit f25f2c5 into main Aug 22, 2025
32 of 34 checks passed
@martincostello martincostello deleted the collection-expressions branch August 22, 2025 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant