Skip to content

Suppress UnassignedGetOnlyAutoProperty for Node.GetHashCode#3138

Merged
jnyrup merged 1 commit intofluentassertions:mainfrom
jnyrup:qodana2
Dec 18, 2025
Merged

Suppress UnassignedGetOnlyAutoProperty for Node.GetHashCode#3138
jnyrup merged 1 commit intofluentassertions:mainfrom
jnyrup:qodana2

Conversation

@jnyrup
Copy link
Copy Markdown
Member

@jnyrup jnyrup commented Dec 17, 2025

The analyzer is correct that GetHashCode() shouldn't use mutable members. See https://www.jetbrains.com/help/rider/NonReadonlyMemberInGetHashCode.html for more details.

For Node however, we only use GetHashCode() when calling Union() in AllPropertiesSelectionRule and AllFieldsSelectionRule. So we should be safe.

IMPORTANT

  • If the PR touches the public API, the changes have been approved in a separate issue with the "api-approved" label.
  • The code complies with the Coding Guidelines for C#.
  • The changes are covered by unit tests which follow the Arrange-Act-Assert syntax and the naming conventions such as is used in these tests.
  • If the PR adds a feature or fixes a bug, please update the release notes with a functional description that explains what the change means to consumers of this library, which are published on the website.
  • If the PR changes the public API the changes needs to be included by running AcceptApiChanges.ps1 or AcceptApiChanges.sh.
  • If the PR affects the documentation, please include your changes in this pull request so the documentation will appear on the website.
    • Please also run ./build.sh --target spellcheck or .\build.ps1 --target spellcheck before pushing and check the good outcome

CONTRIBUTOR LICENSE GRANT

By submitting this contribution, the contributor hereby irrevocably grants to the project owners and maintainers a perpetual, worldwide, royalty-free, irrevocable license to use, reproduce, modify, distribute, sublicense, and create derivative works of the contribution for any purpose and under any terms, including proprietary licensing.

The contributor waives any moral rights in the contribution to the extent permitted by law and agrees not to assert any claim of authorship or control over the contribution. The contributor represents that they are the sole author of the contribution and that it is provided free of any third-party claims.

The contributor understands and agrees that the maintainers may, at their sole discretion, use, license, or redistribute the contribution as part of any work and under any terms they choose, without further permission or attribution.

  • I have read the Contributor License Grant and accept the conditions
  • I'm interested in a free license for Fluent Assertions and will share my email address through [email protected]

The analyzer is correct that `GetHashCode()` shouldn't use mutable members.
See https://www.jetbrains.com/help/rider/NonReadonlyMemberInGetHashCode.html for more details.

For `Node` however, we only use `GetHashCode()` when calling `Union()` in `AllPropertiesSelectionRule` and `AllFieldsSelectionRule`.
So we should be safe.
@github-actions
Copy link
Copy Markdown

Qodana for .NET

It seems all right 👌

No new problems were found according to the checks applied

💡 Qodana analysis was run in the pull request mode: only the changed files were checked
☁️ View the detailed Qodana report

Contact Qodana team

Contact us at [email protected]

@jnyrup jnyrup requested a review from dennisdoomen December 17, 2025 11:06
@jnyrup jnyrup added the building Building and Infrastructure of Fluent Assertions label Dec 18, 2025
@jnyrup jnyrup merged commit b784181 into fluentassertions:main Dec 18, 2025
8 checks passed
@jnyrup jnyrup deleted the qodana2 branch December 18, 2025 07:35
jnyrup added a commit to jnyrup/fluentassertions that referenced this pull request Dec 18, 2025
@jnyrup jnyrup mentioned this pull request Dec 18, 2025
9 tasks
jnyrup added a commit that referenced this pull request Dec 18, 2025
I used the wrong suppression in #3138
This was referenced Mar 16, 2026
This was referenced Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

building Building and Infrastructure of Fluent Assertions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants