Skip to content

Conversation

@Scooletz
Copy link
Contributor

@Scooletz Scooletz commented Nov 24, 2025

https://issues.hibernatingrhinos.com/issue/RavenDB-25423/Raven.CodeAnalysis-add-a-rule-for-method-negation

This PR introduces a diagnoser and a fixer for callsites that uses bool returning methods. To increase readability,

we should prefer the following

 if (TryRead(name, out var reader)) == false)

over this one

if( !TryRead(name, out var reader)))

This PR does not allow opting out of this behavior in any other way than #pragma or [Supress...]

@Scooletz Scooletz force-pushed the bool-methods-diagnostics branch from fdd96eb to f9a7b09 Compare November 25, 2025 10:29
@Scooletz Scooletz changed the title Boolean method negation callsites diagnoser and fixer RavenDB-25423 Boolean method negation callsites diagnoser and fixer Nov 25, 2025
@Scooletz Scooletz marked this pull request as ready for review November 25, 2025 12:21
@ppekrol ppekrol merged commit d21cfb5 into ravendb:master Nov 25, 2025
1 check passed
@Scooletz Scooletz deleted the bool-methods-diagnostics branch November 26, 2025 08:35
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