Skip to content

diagnostic range is off when the line is indented with tabs #203

@InSyncWithFoo

Description

@InSyncWithFoo

Given this file:

def f():
	return (1 == '2')()  # Tab indented

Ruff gets the range correctly:

$ ruff check --select PLR0133 --isolated
foo.py:2:10: PLR0133 Two constants compared in a comparison, consider replacing `1 == '2'`
  |
1 | def f():
2 |     return (1 == '2')()  # Tab indented
  |             ^ PLR0133
  |

Found 1 error.

But Red Knot doesn't:

$ red_knot check --venv-path .venv
error: lint:call-non-callable
 --> ~\project\foo.py:2:9
  |
1 | def f():
2 |     return (1 == '2')()  # Tab indented
  |        ^^^^^^^^^^^^ Object of type `bool` is not callable
  |

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdiagnosticsRelated to reporting of diagnostics.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions