astral-sh / astral-sh/ruff

rule for always false condition

Open
#6,963 2 comments 0 reactions 0 assignees View on GitHub
rule
Dominant language
Rust
Stars
49.6k
Forks
2.4k
Avg merge
2d 1h
Merged PRs (30d)
458

Description

new_header is an int type
below condition can never be satisfied, any rule to highlight this?

`if new_header and new_header == 0:`

Contributor guide

Open the contributing guide

Research direction

Start by examining Ruff’s existing rule definitions and tests for comparable always-false or redundant-condition diagnostics, then reproduce the Python example from the issue. Clarify the intended truthiness semantics and confirm that the finished rule reports this condition with regression coverage.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, rust
Domain
devtools
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.