snapshots

This commit is contained in:
dylwil3 2025-12-08 12:42:51 -06:00
parent 2a5d66bb13
commit b924cd6945
6 changed files with 131 additions and 23 deletions

View File

@ -228,7 +228,7 @@ class Random:
}
{
@@ -139,17 +133,17 @@
@@ -139,17 +133,16 @@
class Random:
def func():
@ -244,9 +244,8 @@ class Random:
- "actionTimestamp": (
- Timestamp(seconds=1530584000, nanos=0).ToJsonString()
- ),
+ "actionTimestamp": Timestamp(
+ seconds=1530584000, nanos=0
+ ).ToJsonString(),
+ "actionTimestamp": Timestamp(seconds=1530584000, nanos=0)
+ .ToJsonString(),
}
},
- }
@ -399,9 +398,8 @@ class Random:
"timestamp": 1234,
"latitude": 1,
"longitude": 2,
"actionTimestamp": Timestamp(
seconds=1530584000, nanos=0
).ToJsonString(),
"actionTimestamp": Timestamp(seconds=1530584000, nanos=0)
.ToJsonString(),
}
},
})

View File

@ -414,12 +414,12 @@ a = b if """
+ """cow
+moos"""
+}
+[
+ """cow
+moos"""
+]
[
"""cow
+moos"""
+]
+[
+ """cow
moos""",
@@ -206,7 +245,9 @@
"c"

View File

@ -2914,6 +2914,19 @@ def length_rst_in_section():
```diff
--- Stable
+++ Preview
@@ -683,9 +683,9 @@
... self._df.filter(pl.col(col).str.starts_with(c))
... for c in sorted(
... set(
- ... df.select(
- ... pl.col(col).str.slice(0, 1)
- ... ).to_series()
+ ... df
+ ... .select(pl.col(col).str.slice(0, 1))
+ ... .to_series()
... )
... )
... ]
@@ -700,9 +700,11 @@
Examples

View File

@ -429,3 +429,20 @@ variable = (
.first_method("some string")
)
```
## Preview changes
```diff
--- Stable
+++ Preview
@@ -171,7 +171,8 @@
if (
(
something # a comment
- ).first_method("some string") # second comment
+ )
+ .first_method("some string") # second comment
):
pass
```

View File

@ -1,7 +1,6 @@
---
source: crates/ruff_python_formatter/tests/fixtures.rs
input_file: crates/ruff_python_formatter/resources/test/fixtures/ruff/expression/split_empty_brackets.py
snapshot_kind: text
---
## Input
```python
@ -199,7 +198,24 @@ response = await sync_to_async(
```diff
--- Stable
+++ Preview
@@ -62,9 +62,9 @@
@@ -18,10 +18,14 @@
).casefold(1)
ct_match = (
- unicodedata.normalize("NFKC", s1).casefold(
+ unicodedata
+ .normalize("NFKC", s1)
+ .casefold(
# foo
)
- == unicodedata.normalize("NFKCNFKCNFKCNFKCNFKC", s2).casefold(
+ == unicodedata
+ .normalize("NFKCNFKCNFKCNFKCNFKC", s2)
+ .casefold(
# foo
)
)
@@ -62,9 +66,9 @@
1
}.unicodedata.normalize("NFKCNFKCNFKCNFKCNFKC", s2).casefold()

View File

@ -472,7 +472,26 @@ max_message_id = (
```diff
--- Stable
+++ Preview
@@ -21,7 +21,8 @@
@@ -4,11 +4,13 @@
aksjdhflsakhdflkjsadlfajkslhfdkjsaldajlahflashdfljahlfksajlhfajfjfsaahflakjslhdfkjalhdskjfa
).a(aaaa)
-raise OsError(
- "sökdjffffsldkfjlhsakfjhalsökafhsöfdahsödfjösaaksjdllllllllllllll"
-) from a.aaaaa(
- aksjdhflsakhdflkjsadlfajkslhfdkjsaldajlahflashdfljahlfksajlhfajfjfsaahflakjslhdfkjalhdskjfa
-).a(aaaa)
+raise OsError("sökdjffffsldkfjlhsakfjhalsökafhsöfdahsödfjösaaksjdllllllllllllll") from (
+ a
+ .aaaaa(
+ aksjdhflsakhdflkjsadlfajkslhfdkjsaldajlahflashdfljahlfksajlhfajfjfsaahflakjslhdfkjalhdskjfa
+ )
+ .a(aaaa)
+)
a1 = Blog.objects.filter(entry__headline__contains="Lennon").filter(
entry__pub_date__year=2008
@@ -21,7 +23,8 @@
)
raise OsError("") from (
@ -482,7 +501,7 @@ max_message_id = (
entry__headline__contains="Lennon",
)
.filter(
@@ -33,7 +34,8 @@
@@ -33,7 +36,8 @@
)
raise OsError("sökdjffffsldkfjlhsakfjhalsökafhsöfdahsödfjösaaksjdllllllllllllll") from (
@ -492,7 +511,7 @@ max_message_id = (
entry__headline__contains="Lennon",
)
.filter(
@@ -46,7 +48,8 @@
@@ -46,7 +50,8 @@
# Break only after calls and indexing
b1 = (
@ -502,7 +521,7 @@ max_message_id = (
.filter(
models.Customer.account_id == account_id, models.Customer.email == email_address
)
@@ -54,7 +57,8 @@
@@ -54,7 +59,8 @@
)
b2 = (
@ -512,8 +531,17 @@ max_message_id = (
entry__headline__contains="Lennon",
)
.limit_results[:10]
@@ -70,7 +74,8 @@
).filter(
@@ -65,12 +71,15 @@
# Nested call chains
c1 = (
- Blog.objects.filter(
+ Blog.objects
+ .filter(
entry__headline__contains="Lennon",
- ).filter(
+ )
+ .filter(
entry__pub_date__year=2008,
)
- + Blog.objects.filter(
@ -522,7 +550,7 @@ max_message_id = (
entry__headline__contains="McCartney",
)
.limit_results[:10]
@@ -89,7 +94,8 @@
@@ -89,19 +98,23 @@
d11 = x.e().e().e() #
d12 = x.e().e().e() #
d13 = (
@ -532,7 +560,14 @@ max_message_id = (
.e()
.e()
)
@@ -101,7 +107,8 @@
# Doesn't fit, default
d2 = (
- x.e().esadjkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkfsdddd() #
+ x
+ .e()
+ .esadjkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkfsdddd() #
)
# Doesn't fit, fluent style
d3 = (
@ -542,7 +577,32 @@ max_message_id = (
.esadjkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk()
.esadjkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk()
)
@@ -218,7 +225,8 @@
@@ -199,16 +212,21 @@
(
(
- df1_aaaaaaaaaaaa.merge().groupby(
+ df1_aaaaaaaaaaaa
+ .merge()
+ .groupby(
1,
)
- ).sum()
+ )
+ .sum()
)
(
(
- df1_aaaaaaaaaaaa.merge().groupby(
+ df1_aaaaaaaaaaaa
+ .merge()
+ .groupby(
1,
)
)
@@ -218,17 +236,20 @@
(
(
@ -552,7 +612,11 @@ max_message_id = (
.groupby(
1,
)
@@ -228,7 +236,8 @@
.bar()
- ).sum()
+ )
+ .sum()
)
(
(