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

E999 Syntax error on match statement with python 3.10 #1783

Closed
leddy231 opened this issue Jan 11, 2023 · 6 comments
Closed

E999 Syntax error on match statement with python 3.10 #1783

leddy231 opened this issue Jan 11, 2023 · 6 comments

Comments

@leddy231
Copy link

leddy231 commented Jan 11, 2023

Incredible tool so far, working on replacing all of pylint in our monorepo with ruff right now, and using the vscode extension.

Bug:
Ruff seams to not be able to handle python 3.10 match cases?
Got it down to a very small working example, even specifying py310 in pyproject.toml or from command line does not work.
This example is just one python file, no pyproject.toml or ruff.toml.

image

Here is the small code snippet.

import os # should trigger "unused import"

match "x":
  case "x":
    print("x")

Edit:
Here is a Dockerfile that re-creates the bug, so it is nothing weird on my machine

FROM python:3.10-alpine

RUN pip install ruff
RUN echo "match 'x':"     >> test.py
RUN echo "  case 'x':"    >> test.py
RUN echo "    print('x')" >> test.py
RUN python test.py
RUN ruff --target-version "py310" test.py
@messense
Copy link
Contributor

Duplicate of #282

@leddy231
Copy link
Author

leddy231 commented Jan 11, 2023

And i though i was good at searching github issues... 😅

@charliermarsh
Copy link
Member

All good :) We're working on it!

@charliermarsh
Copy link
Member

Fixed as of v0.0.250 which included match statement support.

@SirDank
Copy link

SirDank commented Feb 27, 2025

@charliermarsh got this on Python 3.12.8

@MichaReiser
Copy link
Member

@SirDank see #16417

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

No branches or pull requests

5 participants