Skip to content

Commit ef90332

Browse files
Fix code formatting (ruff).
1 parent cd7c6a2 commit ef90332

File tree

5 files changed

+8
-15
lines changed

5 files changed

+8
-15
lines changed

examples/dialogs/progress_dialog.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ def worker(set_percentage, log_text):
3838
def main():
3939
progress_dialog(
4040
title="Progress dialog example",
41-
text="As an examples, we walk through the filesystem and print "
42-
"all directories",
41+
text="As an examples, we walk through the filesystem and print all directories",
4342
run_callback=worker,
4443
).run()
4544

examples/prompts/colored-prompt.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,7 @@ def example_3():
6666
Using ANSI for the formatting.
6767
"""
6868
answer = prompt(
69-
ANSI(
70-
"\x1b[31mjohn\x1b[0m@"
71-
"\x1b[44mlocalhost\x1b[0m:"
72-
"\x1b[4m/user/john\x1b[0m"
73-
"# "
74-
)
69+
ANSI("\x1b[31mjohn\x1b[0m@\x1b[44mlocalhost\x1b[0m:\x1b[4m/user/john\x1b[0m# ")
7570
)
7671
print(f"You said: {answer}")
7772

src/prompt_toolkit/filters/base.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,7 @@ def __bool__(self) -> None:
8181
instead of for instance ``filter1 or Always()``.
8282
"""
8383
raise ValueError(
84-
"The truth value of a Filter is ambiguous. "
85-
"Instead, call it as a function."
84+
"The truth value of a Filter is ambiguous. Instead, call it as a function."
8685
)
8786

8887

src/prompt_toolkit/layout/processors.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -847,9 +847,9 @@ def filter_processor(item: Processor) -> Processor | None:
847847
def apply_transformation(self, ti: TransformationInput) -> Transformation:
848848
from .controls import SearchBufferControl
849849

850-
assert isinstance(
851-
ti.buffer_control, SearchBufferControl
852-
), "`ReverseSearchProcessor` should be applied to a `SearchBufferControl` only."
850+
assert isinstance(ti.buffer_control, SearchBufferControl), (
851+
"`ReverseSearchProcessor` should be applied to a `SearchBufferControl` only."
852+
)
853853

854854
source_to_display: SourceToDisplay | None
855855
display_to_source: DisplayToSource | None

tests/test_cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -870,11 +870,11 @@ def test_vi_temp_navigation_mode():
870870
"""
871871
feed = partial(_feed_cli_with_input, editing_mode=EditingMode.VI)
872872

873-
result, cli = feed("abcde" "\x0f" "3h" "x\r") # c-o # 3 times to the left.
873+
result, cli = feed("abcde\x0f3hx\r") # c-o # 3 times to the left.
874874
assert result.text == "axbcde"
875875
assert result.cursor_position == 2
876876

877-
result, cli = feed("abcde" "\x0f" "b" "x\r") # c-o # One word backwards.
877+
result, cli = feed("abcde\x0fbx\r") # c-o # One word backwards.
878878
assert result.text == "xabcde"
879879
assert result.cursor_position == 1
880880

0 commit comments

Comments
 (0)