You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying out ruff on a greenfield project (loving it so far! Thank you for it!) where I get to use all the latest python goodies, and I've discovered that it doesn't seem like ruff (v0.0.169) likes match/case:
Simple example:
ruff - <<EOF
name = "abc"
match name:
case "def":
print("def")
case _:
print("default")
EOF
Found 1 error(s).
-:2:8: E999 SyntaxError: invalid syntax. Got unexpected token 'name'
(Replace ruff with python and it'll run fine, of course.)
Close as duplicate of #282 - sorry I clearly massively failed in searching (I think I was looking for case match and not "pattern matching". I wasn't aware that is what it was called in python until I went to find the PEP for it)
I'm trying out ruff on a greenfield project (loving it so far! Thank you for it!) where I get to use all the latest python goodies, and I've discovered that it doesn't seem like ruff (v0.0.169) likes
match
/case
:Simple example:
(Replace
ruff
withpython
and it'll run fine, of course.)This syntax was added via https://peps.python.org/pep-0634/ in Python 3.10
I'll won't be able to get around to attempting a PR for this before the New Year, if someone beats me to it I owe you a drink of your choice!
The text was updated successfully, but these errors were encountered: