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

Update to using C# 12 #1046

Merged
merged 1 commit into from
Nov 18, 2023
Merged

Update to using C# 12 #1046

merged 1 commit into from
Nov 18, 2023

Conversation

atifaziz
Copy link
Member

This PR allows the use of the C# 12 going forward and updates the code base to take advantage of primary constructors and collection expressions to reduce ceremony.

Copy link

codecov bot commented Nov 17, 2023

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (9a4ea61) 92.62% compared to head (07434c2) 92.51%.

❗ Current head 07434c2 differs from pull request most recent head 80ab81c. Consider uploading reports for the commit 80ab81c to get more accurate results

Files Patch % Lines
MoreLinq/Delegating.cs 62.50% 0 Missing and 3 partials ⚠️
MoreLinq/ReverseComparer.cs 50.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1046      +/-   ##
==========================================
- Coverage   92.62%   92.51%   -0.12%     
==========================================
  Files         113      112       -1     
  Lines        3419     3405      -14     
  Branches     1055     1056       +1     
==========================================
- Hits         3167     3150      -17     
  Misses        189      189              
- Partials       63       66       +3     

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

@atifaziz atifaziz merged commit 80ab81c into morelinq:master Nov 18, 2023
2 checks passed
@atifaziz atifaziz deleted the cs12 branch November 18, 2023 12:18
Copy link
Contributor

@viceroypenguin viceroypenguin left a comment

Choose a reason for hiding this comment

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

Sorry, I didn't get a chance to review this yesterday. LGTM. I would add these four errors to the .editorconfig, though:

# Primary Constructors
dotnet_diagnostic.CS9107.severity = error               # CS9107: Parameter is captured into the state of the enclosing type and its value is also passed to the base constructor.
dotnet_diagnostic.CS9113.severity = error               # CS9113: Parameter is unread.
dotnet_diagnostic.CS9124.severity = error               # CS9124: Parameter is captured into the state of the enclosing type and its value is also used to initialize a field, property, or event.
dotnet_diagnostic.CS9179.severity = error               # CS9179: Primary constructor parameter is shadowed by a member from base.

This gives confidence in correct behavior with regards to the use of parameter values being used only once and not being overwritten incorrectly.

@atifaziz
Copy link
Member Author

Sorry, I didn't get a chance to review this yesterday. LGTM.

No worries and feel free to comment still if you see something, or better yet, open an issue to track.

I would add these four errors to the .editorconfig, though:

I don't it's needed since those warnings, or in fact all warnings, will be promoted to errors by the following default:

<TreatWarningsAsErrors>true</TreatWarningsAsErrors>

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