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

[Panic] Accidental Space after function name (instead of opening parenthesis) crashes Ruff #11105

Closed
greywidget opened this issue Apr 23, 2024 · 6 comments
Labels
parser Related to the parser

Comments

@greywidget
Copy link

Keywords checked: "function name", "trailing space"

I was starting to define a Django View and accidentally hit "space" instead of "left parenthesis" after View function name:

from django.shortcuts import render
from .models import Post

def post<accidental space here>

Using Ruff plugin for VSCode. Ruff version: 0.4.0

Error

Ruff: Lint failed (...

thread 'main' panicked at D:\a\ruff\ruff\crates\ruff_text_size\src\range.rs:48:9:
assertion failed: start.raw <= end.raw
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
)

pyproject.toml relevant settings:

[tool.ruff]
line-length = 88

[tool.ruff.lint]
select = ["E", "F", "I"]
ignore = ["E501"]
@AlexWaygood
Copy link
Member

AlexWaygood commented Apr 23, 2024

Hi, thanks for the report! I think this might already be fixed on the latest version (ruff 0.4.1). Cc. @dhruvmanila

@AlexWaygood AlexWaygood added the parser Related to the parser label Apr 23, 2024
@AlexWaygood
Copy link
Member

See #11037 and #11032

@greywidget
Copy link
Author

greywidget commented Apr 23, 2024

Yes, I see you are correct - it no longer occurs once I upgraded to 0.4.1

Sorry - I'll make sure I upgrade to the latest version next time before raising any issues.

@AlexWaygood
Copy link
Member

AlexWaygood commented Apr 23, 2024

Yes, I see you are correct - it no longer occurs once I upgraded to 0.4.1

Sorry - I'll make sure I upgrade to the latest version next time before raising any issues.

Thanks for confirming! No worries :-)

Should I close this or is it something you do?

Either is fine ;-)

@greywidget
Copy link
Author

Already fixed in 0.4.1

@charliermarsh
Copy link
Member

Thanks @greywidget

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
parser Related to the parser
Projects
None yet
Development

No branches or pull requests

3 participants