Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
776ab5d
Match CPython's SyntaxError range for unparenthesized `except` types
zzarbttoo Sep 6, 2026
e491d0d
Clarify that the `except` error range stops before the closing colon
zzarbttoo Sep 20, 2026
abacad2
Fix the `except ... as` error column for non-ASCII names and line joins
zzarbttoo Sep 20, 2026
5931324
Update the Ruff fork to 0.16.10
youknowone Oct 4, 2026
264650b
Drop the source scan for the `except ... as` error range
youknowone Oct 4, 2026
c1ed646
Take parse error messages from the parser as they are
youknowone Oct 4, 2026
fe81dff
Take starred and bytes literal error ranges from the parser
youknowone Oct 4, 2026
718e61a
Take indentation error kinds and positions from the parser
youknowone Oct 4, 2026
645631b
Take unterminated string messages from the parser
youknowone Oct 4, 2026
8f74913
Take bracket errors and tokenizer error priority from the parser
youknowone Oct 4, 2026
61b4032
Take number literal, string prefix and non-printable errors from the …
youknowone Oct 4, 2026
efe3856
Take the missing indented block error from the parser
youknowone Oct 4, 2026
b4660b4
Take binding target errors from the parser
youknowone Oct 4, 2026
2523208
Take parameter, argument, star, comma and dictionary errors from the …
youknowone Oct 4, 2026
13f1a00
Take expression errors from the parser
youknowone Oct 4, 2026
a47ad11
Take statement errors from the parser
youknowone Oct 5, 2026
450242a
Take string and f-string errors from the parser
youknowone Oct 5, 2026
f5af0dd
Restore the bracket depth check and fix incomplete unclosed strings
youknowone Oct 6, 2026
8cfafa1
Report multiple statements before later errors in single mode
youknowone Oct 6, 2026
a099d0b
Update the Ruff fork for parser speed and starred annotations
youknowone Oct 6, 2026
820917a
Use the published Ruff fork 0.16.10 crates
youknowone Oct 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Take parameter, argument, star, comma and dictionary errors from the …
…parser

Bump the ruff fork to 36919b62fa. Remove the source scanners for type
parameters, parameter lists, star annotations, call arguments, def type
parameters, parenthesized groups, missing commas and dictionary items.
Set end_offset 0 for ExpectedColonAfterDictionaryKey. Remove 14
EXPECTED_FAILURE markers in test_syntax and test_unpack_ex.

Assisted-by: Claude Code:claude-opus-5-5
  • Loading branch information
youknowone committed Oct 4, 2026
commit 2523208419a57360fb9149cda0e80a2b9992a064
10 changes: 5 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,10 @@ rustpython-wtf8 = { path = "crates/wtf8", version = "0.6.1" }
rustpython-doc = { path = "crates/doc", version = "0.6.1" }

# Use the RustPython Ruff fork for RustPython public `_ast` metadata.
ruff_python_parser = { package = "rustpython-ruff_python_parser", git = "https://github.com/RustPython/ruff.git", rev = "2652b5716988eb21cbaa8597793730042b868ba4" }
ruff_python_ast = { package = "rustpython-ruff_python_ast", git = "https://github.com/RustPython/ruff.git", rev = "2652b5716988eb21cbaa8597793730042b868ba4" }
ruff_text_size = { package = "rustpython-ruff_text_size", git = "https://github.com/RustPython/ruff.git", rev = "2652b5716988eb21cbaa8597793730042b868ba4" }
ruff_source_file = { package = "rustpython-ruff_source_file", git = "https://github.com/RustPython/ruff.git", rev = "2652b5716988eb21cbaa8597793730042b868ba4" }
ruff_python_parser = { package = "rustpython-ruff_python_parser", git = "https://github.com/RustPython/ruff.git", rev = "36919b62fa1b32c57b429de93c7aa0f4b2572164" }
ruff_python_ast = { package = "rustpython-ruff_python_ast", git = "https://github.com/RustPython/ruff.git", rev = "36919b62fa1b32c57b429de93c7aa0f4b2572164" }
ruff_text_size = { package = "rustpython-ruff_text_size", git = "https://github.com/RustPython/ruff.git", rev = "36919b62fa1b32c57b429de93c7aa0f4b2572164" }
ruff_source_file = { package = "rustpython-ruff_source_file", git = "https://github.com/RustPython/ruff.git", rev = "36919b62fa1b32c57b429de93c7aa0f4b2572164" }

der = { version = "0.8", features = ["alloc", "oid", "pem", "zeroize"] }
phf = { version = "0.14.0", default-features = false, features = ["macros"]}
Expand Down
24 changes: 12 additions & 12 deletions Lib/test/test_syntax.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@
Traceback (most recent call last):
SyntaxError: invalid syntax

>>> def foo(/,a,b=,c): # TODO: RUSTPYTHON; Wrong error message # doctest: +EXPECTED_FAILURE
>>> def foo(/,a,b=,c):
... pass
Traceback (most recent call last):
SyntaxError: at least one argument must precede /
Expand Down Expand Up @@ -1185,7 +1185,7 @@
Traceback (most recent call last):
SyntaxError: expected ':'

>>> with (blech as something) # TODO: RUSTPYTHON; Wrong error message # doctest: +EXPECTED_FAILURE
>>> with (blech as something)
... pass
Traceback (most recent call last):
SyntaxError: expected ':'
Expand All @@ -1195,12 +1195,12 @@
Traceback (most recent call last):
SyntaxError: expected ':'

>>> with (blech, block as something) # TODO: RUSTPYTHON; Wrong error message # doctest: +EXPECTED_FAILURE
>>> with (blech, block as something)
... pass
Traceback (most recent call last):
SyntaxError: expected ':'

>>> with (blech, block as something, bluch) # TODO: RUSTPYTHON; Wrong error message # doctest: +EXPECTED_FAILURE
>>> with (blech, block as something, bluch)
... pass
Traceback (most recent call last):
SyntaxError: expected ':'
Expand Down Expand Up @@ -1464,7 +1464,7 @@
Traceback (most recent call last):
SyntaxError: invalid syntax

>>> dict(x=34, (x for x in range 10), 1); x $ y # TODO: RUSTPYTHON; Wrong error message # doctest: +EXPECTED_FAILURE
>>> dict(x=34, (x for x in range 10), 1); x $ y
Traceback (most recent call last):
SyntaxError: invalid syntax

Expand Down Expand Up @@ -2077,26 +2077,26 @@
Traceback (most recent call last):
SyntaxError: cannot use literal as import target

>>> from a import (b as c.d) # TODO: RUSTPYTHON; Wrong error message # doctest: +EXPECTED_FAILURE
>>> from a import (b as c.d)
Traceback (most recent call last):
SyntaxError: cannot use attribute as import target

>>> from a import b as 1
Traceback (most recent call last):
SyntaxError: cannot use literal as import target

>>> from a import ( # TODO: RUSTPYTHON; Wrong error message # doctest: +EXPECTED_FAILURE
>>> from a import (
... b as f())
Traceback (most recent call last):
SyntaxError: cannot use function call as import target

>>> from a import ( # TODO: RUSTPYTHON; Wrong error message # doctest: +EXPECTED_FAILURE
>>> from a import (
... b as [],
... )
Traceback (most recent call last):
SyntaxError: cannot use list as import target

>>> from a import ( # TODO: RUSTPYTHON; Wrong error message # doctest: +EXPECTED_FAILURE
>>> from a import (
... b,
... c as ()
... )
Expand Down Expand Up @@ -2269,7 +2269,7 @@
Traceback (most recent call last):
SyntaxError: cannot use expression as pattern target

>>> match ...: # TODO: RUSTPYTHON; Wrong error message # doctest: +EXPECTED_FAILURE
>>> match ...:
... case (32 as x) | (42 as a()):
... ...
Traceback (most recent call last):
Expand Down Expand Up @@ -2375,7 +2375,7 @@

A[*:] and A[:*]

>>> A[*:] # TODO: RUSTPYTHON; Wrong error message # doctest: +EXPECTED_FAILURE
>>> A[*:]
Traceback (most recent call last):
...
SyntaxError: Invalid star expression
Expand All @@ -2386,7 +2386,7 @@

A[*]

>>> A[*] # TODO: RUSTPYTHON; Wrong error message # doctest: +EXPECTED_FAILURE
>>> A[*]
Traceback (most recent call last):
...
SyntaxError: Invalid star expression
Expand Down
4 changes: 2 additions & 2 deletions Lib/test/test_unpack_ex.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@
...
SyntaxError: cannot use starred expression here

>>> (((*x))),y = 1, 2 # TODO: RUSTPYTHON # doctest:+ELLIPSIS +EXPECTED_FAILURE
>>> (((*x))),y = 1, 2 # doctest:+ELLIPSIS
Traceback (most recent call last):
...
SyntaxError: cannot use starred expression here
Expand All @@ -376,7 +376,7 @@
...
SyntaxError: cannot use starred expression here

>>> ((*x),y) = 1, 2 # TODO: RUSTPYTHON # doctest:+ELLIPSIS +EXPECTED_FAILURE
>>> ((*x),y) = 1, 2 # doctest:+ELLIPSIS
Traceback (most recent call last):
...
SyntaxError: cannot use starred expression here
Expand Down
Loading