lint/complexity/no-redundant-null-check
In the code-quality set. Safe fix.
What it does
Return the value directly instead of checking it for null first.
Configuration
[lint.rules]
"complexity/no-redundant-null-check" = "error"
To skip it in some files or lines, add an override or an ignore comment.
Options
| Name | Type | Allowed values | Default | Upstream name |
|---|---|---|---|---|
checks |
list |
not-null, nullable |
["not-null", "nullable"] |
None (Pun’s own) |
Replaces
SimplifyIfNotNullReturn(rector)SimplifyIfNullableReturn(rector)
Merged rules
These old IDs are now this rule. A config that still names one stops with an error. See merged rules.
lint/complexity/no-redundant-nullable-check