Skip to content

Commit 3c59bb8

Browse files
committed
run hatch fmt on legacy docs
1 parent 48ecf9d commit 3c59bb8

File tree

6 files changed

+9
-10
lines changed

6 files changed

+9
-10
lines changed

docs/docs_app/examples.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
from __future__ import annotations
22

3-
from collections.abc import Iterator
3+
from collections.abc import Callable, Iterator
44
from io import StringIO
55
from pathlib import Path
66
from traceback import format_exc
7-
from typing import Callable
87

98
import reactpy
109
from reactpy.types import ComponentType
@@ -154,7 +153,7 @@ def getvalue(self) -> str:
154153

155154
def write(self, text: str) -> None:
156155
if len(self._lines) == self._max_lines:
157-
self._lines = self._lines[1:] + (text,)
156+
self._lines = (*self._lines[1:], text)
158157
else:
159158
self._lines += (text,)
160159
if self._callback is not None:

docs/docs_app/prod.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
def main() -> None:
99
app.run(
1010
host="0.0.0.0", # noqa: S104
11-
port=int(os.environ.get("PORT", 5000)),
12-
workers=int(os.environ.get("WEB_CONCURRENCY", 1)),
11+
port=int(os.environ.get("PORT", "5000")),
12+
workers=int(os.environ.get("WEB_CONCURRENCY", "1")),
1313
debug=bool(int(os.environ.get("DEBUG", "0"))),
1414
)

docs/source/guides/adding-interactivity/dangers-of-mutability/_examples/list_replace.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def CounterList():
88
def make_increment_click_handler(index):
99
def handle_click(event):
1010
new_value = counters[index] + 1
11-
set_counters(counters[:index] + [new_value] + counters[index + 1 :])
11+
set_counters([*counters[:index], new_value, *counters[index + 1 :]])
1212

1313
return handle_click
1414

docs/source/reference/_examples/matplotlib_plot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def ExpandableNumberInputs(values, set_values):
2626

2727
def set_value_at_index(event, index=i):
2828
new_value = float(event["target"]["value"] or 0)
29-
set_values(values[:index] + [new_value] + values[index + 1 :])
29+
set_values([*values[:index], new_value, *values[index + 1 :]])
3030

3131
inputs.append(poly_coef_input(i + 1, set_value_at_index))
3232

docs/source/reference/_examples/simple_dashboard.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ async def animate():
5757
"x": last_data_point["x"] + 1,
5858
"y": last_data_point["y"] + random.gauss(mu.current, sigma.current),
5959
}
60-
set_data(data[1:] + [next_data_point])
60+
set_data([*data[1:], next_data_point])
6161

6262
return VictoryLine(
6363
{

docs/source/reference/_examples/snake_game.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def on_direction_change(event):
6868
if hasattr(Direction, event["key"]):
6969
maybe_new_direction = Direction[event["key"]].value
7070
direction_vector_sum = tuple(
71-
map(sum, zip(last_direction, maybe_new_direction))
71+
map(sum, zip(last_direction, maybe_new_direction, strict=False))
7272
)
7373
if direction_vector_sum != (0, 0):
7474
direction.current = maybe_new_direction
@@ -109,7 +109,7 @@ async def animate():
109109
set_food()
110110
new_snake = [*snake, new_snake_head]
111111
else:
112-
new_snake = snake[1:] + [new_snake_head]
112+
new_snake = [*snake[1:], new_snake_head]
113113

114114
set_snake(new_snake)
115115

0 commit comments

Comments
 (0)