Skip to content

ALL-CONT0002 · evidence

This page continues ALL-CONT0002 directly from its source docstring. Read its implementation.

Each finding names the declaration, the line, and the kind of the value thrown away. The value is the number of statements without an effect.

A call, an await, and a string are never counted. A call may do all its work through a side effect, an await always can, and a string alone is a docstring or a comment in the languages that allow one. An index is not counted either, because reading through an operator a type defines is how several libraries probe for something and how a mapping raises when it is missing. An operation reaching its operands through anything but a comparison, a membership test, or a negation is left alone, which keeps a plumbum command & FG and an Airflow `first

secondout of the findings and costs only the rare barea < b. A statement whose frontend states nothing beneath it is not judged. Neither is a statement whose expression the frontend marked in place, replacing the kind of the value with the mark, because the fact then no longer states what the line computed and any answer would be read off an operand, so a frontend in that shape reports nothing here rather than guessing. inert_kinds` names the node kinds that can only produce a value, which is what a project extends when its language states one this list has not met.

  • Generalizes Ruff B015 useless-comparison
  • Generalizes Ruff B018 useless-expression
  • Generalizes Clippy no_effect. Open reference
  • Generalizes ESLint no-unused-expressions. Open reference