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

Upgrade LibCST to support Python 3.12 #7764

Merged
merged 1 commit into from
Oct 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 2 additions & 4 deletions Cargo.lock

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

3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ unicode-width = "0.1.11"
uuid = { version = "1.4.1", features = ["v4", "fast-rng", "macro-diagnostics", "js"] }
wsl = { version = "0.1.0" }

# v1.0.1
libcst = { version = "0.1.0", default-features = false }
libcst = { git = "https://github.com/Instagram/LibCST.git", rev = "03179b55ebe7e916f1722e18e8f0b87c01616d1f", default-features = false }

[profile.release]
lto = "fat"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,16 @@ async def main():
with c as c2:
async with d as d2:
f(b2, c2, d2)

# SIM117
with A() as a:
with B() as b:
type ListOrSet[T] = list[T] | set[T]

class ClassA[T: str]:
def method1(self) -> T:
...

f" something { my_dict["key"] } something else "

f"foo {f"bar {x}"} baz"
Original file line number Diff line number Diff line change
Expand Up @@ -284,4 +284,37 @@ SIM117.py:106:5: SIM117 Use a single `with` statement with multiple contexts ins
|
= help: Combine `with` statements

SIM117.py:126:1: SIM117 [*] Use a single `with` statement with multiple contexts instead of nested `with` statements
|
125 | # SIM117
126 | / with A() as a:
127 | | with B() as b:
| |__________________^ SIM117
128 | type ListOrSet[T] = list[T] | set[T]
|
= help: Combine `with` statements

ℹ Suggested fix
123 123 | f(b2, c2, d2)
124 124 |
125 125 | # SIM117
126 |-with A() as a:
127 |- with B() as b:
128 |- type ListOrSet[T] = list[T] | set[T]
126 |+with A() as a, B() as b:
127 |+ type ListOrSet[T] = list[T] | set[T]
129 128 |
130 |- class ClassA[T: str]:
131 |- def method1(self) -> T:
132 |- ...
129 |+ class ClassA[T: str]:
130 |+ def method1(self) -> T:
131 |+ ...
133 132 |
134 |- f" something { my_dict["key"] } something else "
133 |+ f" something { my_dict["key"] } something else "
135 134 |
136 |- f"foo {f"bar {x}"} baz"
135 |+ f"foo {f"bar {x}"} baz"