mirror of https://github.com/astral-sh/ruff
resolve conflicts and update snapshot
This commit is contained in:
parent
7cfaa1fb9c
commit
b0e879df6d
|
|
@ -393,12 +393,14 @@ impl Format<PyFormatContext<'_>> for FormatBody<'_> {
|
||||||
// ```
|
// ```
|
||||||
else if matches!(body, Expr::Call(_) | Expr::Subscript(_)) {
|
else if matches!(body, Expr::Call(_) | Expr::Subscript(_)) {
|
||||||
let unparenthesized = body.format().with_options(Parentheses::Never);
|
let unparenthesized = body.format().with_options(Parentheses::Never);
|
||||||
if CallChainLayout::from_expression(
|
if matches!(
|
||||||
body.into(),
|
CallChainLayout::from_expression(
|
||||||
comments.ranges(),
|
body.into(),
|
||||||
f.context().source(),
|
comments.ranges(),
|
||||||
) == CallChainLayout::Fluent
|
f.context().source(),
|
||||||
{
|
),
|
||||||
|
CallChainLayout::Fluent(_)
|
||||||
|
) {
|
||||||
parenthesize_if_expands(&unparenthesized).fmt(f)
|
parenthesize_if_expands(&unparenthesized).fmt(f)
|
||||||
} else {
|
} else {
|
||||||
let unparenthesized = unparenthesized.memoized();
|
let unparenthesized = unparenthesized.memoized();
|
||||||
|
|
|
||||||
|
|
@ -2155,7 +2155,7 @@ transform = (
|
||||||
),
|
),
|
||||||
param(
|
param(
|
||||||
lambda left, right: (
|
lambda left, right: (
|
||||||
@@ -471,9 +463,9 @@
|
@@ -471,15 +463,16 @@
|
||||||
),
|
),
|
||||||
param(lambda left, right: ibis.timestamp("2017-04-01").cast(dt.date)),
|
param(lambda left, right: ibis.timestamp("2017-04-01").cast(dt.date)),
|
||||||
param(
|
param(
|
||||||
|
|
@ -2168,7 +2168,15 @@ transform = (
|
||||||
),
|
),
|
||||||
# This is too long on one line in the lambda body and gets wrapped
|
# This is too long on one line in the lambda body and gets wrapped
|
||||||
# inside the body.
|
# inside the body.
|
||||||
@@ -507,16 +499,18 @@
|
param(
|
||||||
|
lambda left, right: (
|
||||||
|
- ibis.timestamp("2017-04-01")
|
||||||
|
+ ibis
|
||||||
|
+ .timestamp("2017-04-01")
|
||||||
|
.cast(dt.date)
|
||||||
|
.between(left, right)
|
||||||
|
.between(left, right)
|
||||||
|
@@ -507,16 +500,18 @@
|
||||||
]
|
]
|
||||||
|
|
||||||
# adds parentheses around the body
|
# adds parentheses around the body
|
||||||
|
|
@ -2190,7 +2198,7 @@ transform = (
|
||||||
|
|
||||||
lambda x, y, z: (
|
lambda x, y, z: (
|
||||||
x + y + z
|
x + y + z
|
||||||
@@ -527,7 +521,7 @@
|
@@ -527,7 +522,7 @@
|
||||||
x + y + z # trailing eol body
|
x + y + z # trailing eol body
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -2199,7 +2207,7 @@ transform = (
|
||||||
|
|
||||||
lambda x, y, z: (
|
lambda x, y, z: (
|
||||||
# leading body
|
# leading body
|
||||||
@@ -539,21 +533,23 @@
|
@@ -539,21 +534,23 @@
|
||||||
)
|
)
|
||||||
|
|
||||||
(
|
(
|
||||||
|
|
@ -2233,7 +2241,7 @@ transform = (
|
||||||
# dangling header comment
|
# dangling header comment
|
||||||
source_bucket
|
source_bucket
|
||||||
if name == source_bucket_name
|
if name == source_bucket_name
|
||||||
@@ -561,8 +557,7 @@
|
@@ -561,8 +558,7 @@
|
||||||
)
|
)
|
||||||
|
|
||||||
(
|
(
|
||||||
|
|
@ -2243,7 +2251,7 @@ transform = (
|
||||||
source_bucket
|
source_bucket
|
||||||
if name == source_bucket_name
|
if name == source_bucket_name
|
||||||
else storage.Bucket(mock_service, destination_bucket_name)
|
else storage.Bucket(mock_service, destination_bucket_name)
|
||||||
@@ -570,61 +565,70 @@
|
@@ -570,61 +566,71 @@
|
||||||
)
|
)
|
||||||
|
|
||||||
(
|
(
|
||||||
|
|
@ -2293,7 +2301,8 @@ transform = (
|
||||||
- .cast(dt.date)
|
- .cast(dt.date)
|
||||||
- .between(left, right)
|
- .between(left, right)
|
||||||
+ lambda left, right: (
|
+ lambda left, right: (
|
||||||
+ ibis.timestamp("2017-04-01") # comment
|
+ ibis
|
||||||
|
+ .timestamp("2017-04-01") # comment
|
||||||
+ .cast(dt.date)
|
+ .cast(dt.date)
|
||||||
+ .between(left, right)
|
+ .between(left, right)
|
||||||
+ )
|
+ )
|
||||||
|
|
@ -2346,7 +2355,7 @@ transform = (
|
||||||
)
|
)
|
||||||
|
|
||||||
(
|
(
|
||||||
@@ -637,27 +641,31 @@
|
@@ -637,27 +643,31 @@
|
||||||
(
|
(
|
||||||
lambda
|
lambda
|
||||||
# comment
|
# comment
|
||||||
|
|
@ -2386,7 +2395,7 @@ transform = (
|
||||||
)
|
)
|
||||||
|
|
||||||
(
|
(
|
||||||
@@ -672,25 +680,28 @@
|
@@ -672,25 +682,28 @@
|
||||||
)
|
)
|
||||||
|
|
||||||
(
|
(
|
||||||
|
|
@ -2427,7 +2436,7 @@ transform = (
|
||||||
)
|
)
|
||||||
|
|
||||||
(
|
(
|
||||||
@@ -698,9 +709,9 @@
|
@@ -698,9 +711,9 @@
|
||||||
# comment 1
|
# comment 1
|
||||||
*ergs,
|
*ergs,
|
||||||
# comment 2
|
# comment 2
|
||||||
|
|
@ -2440,7 +2449,7 @@ transform = (
|
||||||
)
|
)
|
||||||
|
|
||||||
(
|
(
|
||||||
@@ -708,19 +719,20 @@
|
@@ -708,19 +721,20 @@
|
||||||
# 2
|
# 2
|
||||||
left, # 3
|
left, # 3
|
||||||
# 4
|
# 4
|
||||||
|
|
@ -2471,7 +2480,7 @@ transform = (
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -738,48 +750,52 @@
|
@@ -738,48 +752,52 @@
|
||||||
foo(
|
foo(
|
||||||
lambda from_ts, # but still wrap the body if it gets too long
|
lambda from_ts, # but still wrap the body if it gets too long
|
||||||
to_ts,
|
to_ts,
|
||||||
|
|
@ -2548,7 +2557,7 @@ transform = (
|
||||||
)
|
)
|
||||||
|
|
||||||
(
|
(
|
||||||
@@ -828,8 +844,7 @@
|
@@ -828,8 +846,7 @@
|
||||||
)
|
)
|
||||||
|
|
||||||
(
|
(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue