Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Red Knot's diagnostic range is off when the line is indented with tabs #15983

Open
InSyncWithFoo opened this issue Feb 6, 2025 · 0 comments
Open
Labels
bug Something isn't working diagnostics Related to reporting of diagnostics. red-knot Multi-file analysis & type inference

Comments

@InSyncWithFoo
Copy link
Contributor

InSyncWithFoo commented Feb 6, 2025

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
  |
@dhruvmanila dhruvmanila added red-knot Multi-file analysis & type inference diagnostics Related to reporting of diagnostics. labels Feb 6, 2025
@MichaReiser MichaReiser added the bug Something isn't working label Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working diagnostics Related to reporting of diagnostics. red-knot Multi-file analysis & type inference
Projects
None yet
Development

No branches or pull requests

3 participants