Skip to content

CSHARP-6289: Mark private fields readonly where possible (fix) - #2217

Open
papafe wants to merge 2 commits into
mongodb:mainfrom
papafe:csharp6289-net472-format
Open

papafe wants to merge 2 commits into
mongodb:mainfrom
papafe:csharp6289-net472-format

Conversation

@papafe

@papafe papafe commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

@papafe
papafe requested a review from a team as a code owner November 26, 2026 15:36
@papafe
papafe requested review from ajcvickers and a balanced review from Copilot November 26, 2026 15:36
@papafe papafe changed the title CSHARP-6289: Mark private fields readonly where possible CSHARP-6289: Mark private fields readonly where possible (fix) Nov 26, 2026
@papafe
papafe requested review from BorisDog and removed request for ajcvickers November 26, 2026 15:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The review could not verify whether .NET 11’s dotnet format analyzes NET472-only test code when net472 is appended after the other target frameworks on Windows.

No open issues 🎉

What changed in this PR

This follow-up to CSHARP-6289 corrects a test constant’s naming and extends formatting checks to conditional .NET Framework test code.

Changes:

  • Rename the private constant _literal to Literal.
  • Set IsWindows for the formatting step so test projects include net472 and #if NET472 code is checked.
File Description
tests/​MongoDB.Bson.Tests/​Serialization/​NonCompliantMemberClassMapTests.cs Correct the private constant’s naming.
.github/​workflows/​format.yml Include .NET Framework test code in formatting checks.

Review effort: Balanced

@BorisDog BorisDog left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@BorisDog

Copy link
Copy Markdown
Contributor

@papafe this PR might be irrelevant because of #2218

This branch has not been deployed

No deployments
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.

3 participants