Add ruff to the "format" session

`ruff format` adds parentheses around multi-line lambda bodies
and removes blank lines after block openers,
both of which `black` accepts.

Lines with `# type:ignore` are shortened
because `black` counts pragma comments toward the line length
and `ruff` does not.
This commit is contained in:
Alexander Hess 2026-11-28 04:43:49 +01:00
commit e451f03d0f
Signed by: alexander
GPG key ID: B46EDB4DFC26805D

View file

@ -45,12 +45,16 @@ class ScheduledOrderFactory(ad_hoc.AdHocOrderFactory):
# Restaurant-related attributes
restaurant_notified_at = factory.LazyAttribute(
lambda obj: obj.scheduled_delivery_at
- utils.random_timespan(min_minutes=45, max_minutes=50),
lambda obj: (
obj.scheduled_delivery_at
- utils.random_timespan(min_minutes=45, max_minutes=50)
),
)
# Dispatch-related attributes
dispatch_at = factory.LazyAttribute(
lambda obj: obj.scheduled_delivery_at
- utils.random_timespan(min_minutes=40, max_minutes=45),
lambda obj: (
obj.scheduled_delivery_at
- utils.random_timespan(min_minutes=40, max_minutes=45)
),
)