From efdc4e801dfe277812c95cda36905398482675e1 Mon Sep 17 00:00:00 2001 From: Harutaka Kawamura Date: Sun, 11 Dec 2022 09:16:01 +0900 Subject: [PATCH] Upgrade RustPython to fix end location of implicitly concatenated strings (#1187) --- Cargo.lock | 8 ++++---- Cargo.toml | 6 +++--- flake8_to_ruff/Cargo.lock | 8 ++++---- resources/test/fixtures/pyflakes/F541.py | 1 + ruff_dev/Cargo.toml | 6 +++--- .../snapshots/ruff__pyflakes__tests__F541_F541.py.snap | 8 ++++++++ .../snapshots/ruff__pyflakes__tests__F821_F821_0.py.snap | 4 ++-- 7 files changed, 25 insertions(+), 16 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 015046f268..27117d3898 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1935,7 +1935,7 @@ dependencies = [ [[package]] name = "rustpython-ast" version = "0.1.0" -source = "git+https://github.com/RustPython/RustPython.git?rev=28f9f65ccc625f00835d84bbb5fba274dce5aa89#28f9f65ccc625f00835d84bbb5fba274dce5aa89" +source = "git+https://github.com/RustPython/RustPython.git?rev=2edd0d264c50c7807bcff03a52a6509e8b7f187f#2edd0d264c50c7807bcff03a52a6509e8b7f187f" dependencies = [ "num-bigint", "rustpython-common", @@ -1945,7 +1945,7 @@ dependencies = [ [[package]] name = "rustpython-common" version = "0.0.0" -source = "git+https://github.com/RustPython/RustPython.git?rev=28f9f65ccc625f00835d84bbb5fba274dce5aa89#28f9f65ccc625f00835d84bbb5fba274dce5aa89" +source = "git+https://github.com/RustPython/RustPython.git?rev=2edd0d264c50c7807bcff03a52a6509e8b7f187f#2edd0d264c50c7807bcff03a52a6509e8b7f187f" dependencies = [ "ascii", "cfg-if 1.0.0", @@ -1968,7 +1968,7 @@ dependencies = [ [[package]] name = "rustpython-compiler-core" version = "0.1.2" -source = "git+https://github.com/RustPython/RustPython.git?rev=28f9f65ccc625f00835d84bbb5fba274dce5aa89#28f9f65ccc625f00835d84bbb5fba274dce5aa89" +source = "git+https://github.com/RustPython/RustPython.git?rev=2edd0d264c50c7807bcff03a52a6509e8b7f187f#2edd0d264c50c7807bcff03a52a6509e8b7f187f" dependencies = [ "bincode", "bitflags", @@ -1985,7 +1985,7 @@ dependencies = [ [[package]] name = "rustpython-parser" version = "0.1.2" -source = "git+https://github.com/RustPython/RustPython.git?rev=28f9f65ccc625f00835d84bbb5fba274dce5aa89#28f9f65ccc625f00835d84bbb5fba274dce5aa89" +source = "git+https://github.com/RustPython/RustPython.git?rev=2edd0d264c50c7807bcff03a52a6509e8b7f187f#2edd0d264c50c7807bcff03a52a6509e8b7f187f" dependencies = [ "ahash", "anyhow", diff --git a/Cargo.toml b/Cargo.toml index baab540d80..6726b98f10 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -43,9 +43,9 @@ regex = { version = "1.6.0" } ropey = { version = "1.5.0", features = ["cr_lines", "simd"], default-features = false } ruff_macros = { version = "0.0.174", path = "ruff_macros" } rustc-hash = { version = "1.1.0" } -rustpython-ast = { features = ["unparse"], git = "https://github.com/RustPython/RustPython.git", rev = "28f9f65ccc625f00835d84bbb5fba274dce5aa89" } -rustpython-common = { git = "https://github.com/RustPython/RustPython.git", rev = "28f9f65ccc625f00835d84bbb5fba274dce5aa89" } -rustpython-parser = { features = ["lalrpop"], git = "https://github.com/RustPython/RustPython.git", rev = "28f9f65ccc625f00835d84bbb5fba274dce5aa89" } +rustpython-ast = { features = ["unparse"], git = "https://github.com/RustPython/RustPython.git", rev = "2edd0d264c50c7807bcff03a52a6509e8b7f187f" } +rustpython-common = { git = "https://github.com/RustPython/RustPython.git", rev = "2edd0d264c50c7807bcff03a52a6509e8b7f187f" } +rustpython-parser = { features = ["lalrpop"], git = "https://github.com/RustPython/RustPython.git", rev = "2edd0d264c50c7807bcff03a52a6509e8b7f187f" } serde = { version = "1.0.147", features = ["derive"] } serde_json = { version = "1.0.87" } strum = { version = "0.24.1", features = ["strum_macros"] } diff --git a/flake8_to_ruff/Cargo.lock b/flake8_to_ruff/Cargo.lock index 5e110caf1d..f20b24972c 100644 --- a/flake8_to_ruff/Cargo.lock +++ b/flake8_to_ruff/Cargo.lock @@ -2028,7 +2028,7 @@ dependencies = [ [[package]] name = "rustpython-ast" version = "0.1.0" -source = "git+https://github.com/RustPython/RustPython.git?rev=28f9f65ccc625f00835d84bbb5fba274dce5aa89#28f9f65ccc625f00835d84bbb5fba274dce5aa89" +source = "git+https://github.com/RustPython/RustPython.git?rev=2edd0d264c50c7807bcff03a52a6509e8b7f187f#2edd0d264c50c7807bcff03a52a6509e8b7f187f" dependencies = [ "num-bigint", "rustpython-common", @@ -2038,7 +2038,7 @@ dependencies = [ [[package]] name = "rustpython-common" version = "0.0.0" -source = "git+https://github.com/RustPython/RustPython.git?rev=28f9f65ccc625f00835d84bbb5fba274dce5aa89#28f9f65ccc625f00835d84bbb5fba274dce5aa89" +source = "git+https://github.com/RustPython/RustPython.git?rev=2edd0d264c50c7807bcff03a52a6509e8b7f187f#2edd0d264c50c7807bcff03a52a6509e8b7f187f" dependencies = [ "ascii", "cfg-if 1.0.0", @@ -2061,7 +2061,7 @@ dependencies = [ [[package]] name = "rustpython-compiler-core" version = "0.1.2" -source = "git+https://github.com/RustPython/RustPython.git?rev=28f9f65ccc625f00835d84bbb5fba274dce5aa89#28f9f65ccc625f00835d84bbb5fba274dce5aa89" +source = "git+https://github.com/RustPython/RustPython.git?rev=2edd0d264c50c7807bcff03a52a6509e8b7f187f#2edd0d264c50c7807bcff03a52a6509e8b7f187f" dependencies = [ "bincode", "bitflags", @@ -2078,7 +2078,7 @@ dependencies = [ [[package]] name = "rustpython-parser" version = "0.1.2" -source = "git+https://github.com/RustPython/RustPython.git?rev=28f9f65ccc625f00835d84bbb5fba274dce5aa89#28f9f65ccc625f00835d84bbb5fba274dce5aa89" +source = "git+https://github.com/RustPython/RustPython.git?rev=2edd0d264c50c7807bcff03a52a6509e8b7f187f#2edd0d264c50c7807bcff03a52a6509e8b7f187f" dependencies = [ "ahash", "anyhow", diff --git a/resources/test/fixtures/pyflakes/F541.py b/resources/test/fixtures/pyflakes/F541.py index 083211aa12..7d50deae46 100644 --- a/resources/test/fixtures/pyflakes/F541.py +++ b/resources/test/fixtures/pyflakes/F541.py @@ -9,3 +9,4 @@ e = ( ) g = f"ghi{123:{45}}" +h = "x" "y" f"z" diff --git a/ruff_dev/Cargo.toml b/ruff_dev/Cargo.toml index 6b34e1fde7..bcf262846b 100644 --- a/ruff_dev/Cargo.toml +++ b/ruff_dev/Cargo.toml @@ -11,8 +11,8 @@ itertools = { version = "0.10.5" } libcst = { git = "https://github.com/charliermarsh/LibCST", rev = "f2f0b7a487a8725d161fe8b3ed73a6758b21e177" } once_cell = { version = "1.16.0" } ruff = { path = ".." } -rustpython-ast = { features = ["unparse"], git = "https://github.com/RustPython/RustPython.git", rev = "28f9f65ccc625f00835d84bbb5fba274dce5aa89" } -rustpython-common = { git = "https://github.com/RustPython/RustPython.git", rev = "28f9f65ccc625f00835d84bbb5fba274dce5aa89" } -rustpython-parser = { features = ["lalrpop"], git = "https://github.com/RustPython/RustPython.git", rev = "28f9f65ccc625f00835d84bbb5fba274dce5aa89" } +rustpython-ast = { features = ["unparse"], git = "https://github.com/RustPython/RustPython.git", rev = "2edd0d264c50c7807bcff03a52a6509e8b7f187f" } +rustpython-common = { git = "https://github.com/RustPython/RustPython.git", rev = "2edd0d264c50c7807bcff03a52a6509e8b7f187f" } +rustpython-parser = { features = ["lalrpop"], git = "https://github.com/RustPython/RustPython.git", rev = "2edd0d264c50c7807bcff03a52a6509e8b7f187f" } strum = { version = "0.24.1", features = ["strum_macros"] } strum_macros = { version = "0.24.3" } diff --git a/src/pyflakes/snapshots/ruff__pyflakes__tests__F541_F541.py.snap b/src/pyflakes/snapshots/ruff__pyflakes__tests__F541_F541.py.snap index 773f0d0525..81f197ad80 100644 --- a/src/pyflakes/snapshots/ruff__pyflakes__tests__F541_F541.py.snap +++ b/src/pyflakes/snapshots/ruff__pyflakes__tests__F541_F541.py.snap @@ -26,4 +26,12 @@ expression: checks row: 7 column: 10 fix: ~ +- kind: FStringMissingPlaceholders + location: + row: 12 + column: 4 + end_location: + row: 12 + column: 16 + fix: ~ diff --git a/src/pyflakes/snapshots/ruff__pyflakes__tests__F821_F821_0.py.snap b/src/pyflakes/snapshots/ruff__pyflakes__tests__F821_F821_0.py.snap index db14f74cc2..b100bf7a5d 100644 --- a/src/pyflakes/snapshots/ruff__pyflakes__tests__F821_F821_0.py.snap +++ b/src/pyflakes/snapshots/ruff__pyflakes__tests__F821_F821_0.py.snap @@ -71,8 +71,8 @@ expression: checks row: 89 column: 4 end_location: - row: 89 - column: 8 + row: 90 + column: 10 fix: ~ - kind: UndefinedName: PEP593Test123