Skip to content

[dx] Deprecate ExplicitBoolCompareRector, as can make less readable if train - array and objects already handled by split rules - #8412

Merged
TomasVotruba merged 1 commit into
mainfrom
deprecate-explicit-bool-compare
Aug 29, 2026
Merged

[dx] Deprecate ExplicitBoolCompareRector, as can make less readable if train - array and objects already handled by split rules#8412
TomasVotruba merged 1 commit into
mainfrom
deprecate-explicit-bool-compare

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

Array and object bool compares have dedicated rules (ArrayExplicitBoolCompareRector, ObjectExplicitBoolCompareRector); the remaining behavior is an opinionated approach that depends on context. Replace the body with a deprecation message, remove its tests, and unregister it from the if set.

Part of splitting the if-set cleanup into focused PRs.

Array and object bool compares have dedicated rules; the remaining behavior is an opinionated approach that depends on context. Replace the body with a deprecation message, remove its tests, and unregister it from the if set.

Claude-Session: https://claude.ai/code/session_012HQ19gVsT8wVkekuVqVXGx
@TomasVotruba
TomasVotruba force-pushed the deprecate-explicit-bool-compare branch from d90e42d to 1b10882 Compare August 29, 2026 22:23
@TomasVotruba TomasVotruba changed the title [dx] Deprecate ExplicitBoolCompareRector [dx] Deprecate ExplicitBoolCompareRector, as array and objects already handled and can make less readable if train Aug 29, 2026
@TomasVotruba TomasVotruba changed the title [dx] Deprecate ExplicitBoolCompareRector, as array and objects already handled and can make less readable if train [dx] Deprecate ExplicitBoolCompareRector, as can make less readable if train - array and objects already handled by split rules Aug 29, 2026
@TomasVotruba
TomasVotruba merged commit e6c36be into main Aug 29, 2026
44 checks passed
@TomasVotruba
TomasVotruba deleted the deprecate-explicit-bool-compare branch August 29, 2026 22:25
@lode

lode commented Aug 31, 2026

Copy link
Copy Markdown

I'd like to keep this rule, opinionated maybe. Can't we keep the rule outside the if-set, as something that we can manually add to our rules?

@TomasVotruba

Copy link
Copy Markdown
Member Author

Ideally, use its version locally and fine tune to your needs.
I'm narrowing rules to anyone can use safely and reducing niche case we tend to ignore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants