Skip to content

Added readonly modifier to private fields which are never changed - #1451

Merged
martincostello merged 3 commits into
App-vNext:mainfrom
Lehonti:main
Aug 3, 2023
Merged

martincostello merged 3 commits into
App-vNext:mainfrom
Lehonti:main

Conversation

@Lehonti

@Lehonti Lehonti commented Aug 2, 2023 •

Copy link
Copy Markdown
Contributor

Confirm the following

  • I started this PR by branching from the head of the default branch
  • I have targeted the PR to merge into the default branch
  • I have included unit tests for the issue/feature (N/A)
  • I have successfully run a local build

@martincostello

Copy link
Copy Markdown
Member

Thanks for your contribution.

As you can see, the build is now failing due to readonly being incompatible with other uses of these fields in the code. It may be that all of these fields are already not readonly for that very reason.

Please run the build locally and fix any issues to continue with this contribution.

@Lehonti

Lehonti commented Aug 3, 2023 •

Copy link
Copy Markdown
Contributor Author

You are absolutely right.

I managed to reproduce the errors in my local environment, and removed the problematic readonly modifiers. As you can see, there are now less files that have been modified when we compare the PR code to the original (used to be 9, now they are 6).

@martincostello

Copy link
Copy Markdown
Member

The changes are now hitting lint errors. Please get a full clean build locally before pushing further changes.

@Lehonti

Lehonti commented Aug 3, 2023

Copy link
Copy Markdown
Contributor Author

No problem. I planned to fix the linting issues in a future PR, but I didn't have any idea that they were configured to make a build fail. It's understandable, of course. You want to keep the code clean.

The built succeeded in my machine without errors or warnings.

@codecov

codecov Bot commented Aug 3, 2023 •

Copy link
Copy Markdown

Codecov Report

Merging #1451 (8799e05) into main (f8bea05) will not change coverage.
Report is 1 commits behind head on main.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main    #1451   +/-   ##
=======================================
  Coverage   83.90%   83.90%           
=======================================
  Files         273      273           
  Lines        6516     6516           
  Branches     1012     1012           
=======================================
  Hits         5467     5467           
  Misses        840      840           
  Partials      209      209           
Flag Coverage Δ
linux 83.90% <ø> (ø)
macos 83.90% <ø> (ø)
windows 83.90% <ø> (?)

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

Files Changed Coverage Δ
src/Polly/Caching/AsyncCachePolicy.cs 100.00% <ø> (ø)
src/Polly/Caching/CachePolicy.cs 100.00% <ø> (ø)
src/Polly/Timeout/AsyncTimeoutPolicy.cs 87.87% <ø> (ø)
src/Polly/Timeout/TimeoutPolicy.cs 86.66% <ø> (ø)
src/Polly/Wrap/AsyncPolicyWrap.cs 80.51% <ø> (ø)
src/Polly/Wrap/PolicyWrap.cs 80.28% <ø> (ø)

@martincostello
martincostello merged commit 77e91d5 into App-vNext:main Aug 3, 2023
@martincostello

Copy link
Copy Markdown
Member

Thanks!

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.

2 participants