Skip to content

Commit 5fb21bd

Browse files
Apply latest Ruff for formatting.
1 parent 394fe38 commit 5fb21bd

19 files changed

+25
-10
lines changed

examples/asyncio-python-embed.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
to stdout, it won't break the input line, but instead writes nicely above the
1212
prompt.
1313
"""
14+
1415
import asyncio
1516

1617
from ptpython.repl import embed

examples/asyncio-ssh-python-embed.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
66
Run this example and then SSH to localhost, port 8222.
77
"""
8+
89
import asyncio
910
import logging
1011

examples/ptpython_config/config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
On Linux, this is: ~/.config/ptpython/config.py
66
On macOS, this is: ~/Library/Application Support/ptpython/config.py
77
"""
8+
89
from prompt_toolkit.filters import ViInsertMode
910
from prompt_toolkit.key_binding.key_processor import KeyPress
1011
from prompt_toolkit.keys import Keys

examples/python-embed-with-custom-prompt.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"""
33
Example of embedding a Python REPL, and setting a custom prompt.
44
"""
5+
56
from prompt_toolkit.formatted_text import HTML, AnyFormattedText
67

78
from ptpython.prompt_style import PromptStyle

examples/python-embed.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python
2-
"""
3-
"""
2+
""" """
3+
44
from ptpython.repl import embed
55

66

examples/python-input.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python
2-
"""
3-
"""
2+
""" """
3+
44
from ptpython.python_input import PythonInput
55

66

examples/test-cases/ptpython-in-other-thread.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
(For testing whether it's working fine if it's not embedded in the main
66
thread.)
77
"""
8+
89
import threading
910

1011
from ptpython.repl import embed

ptpython/__main__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Make `python -m ptpython` an alias for running `./ptpython`.
33
"""
4+
45
from __future__ import annotations
56

67
from .entry_points.run_ptpython import run

ptpython/contrib/asyncssh_repl.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
should make sure not to use Python 3-only syntax, because this
77
package should be installable in Python 2 as well!
88
"""
9+
910
from __future__ import annotations
1011

1112
import asyncio

ptpython/entry_points/run_ptpython.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
PTPYTHON_CONFIG_HOME: a configuration directory to use
2323
PYTHONSTARTUP: file executed on interactive startup (no default)
2424
"""
25+
2526
from __future__ import annotations
2627

2728
import argparse

ptpython/eventloop.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
in readline. ``prompt-toolkit`` doesn't understand that input hook, but this
88
will fix it for Tk.)
99
"""
10+
1011
from __future__ import annotations
1112

1213
import sys

ptpython/history_browser.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
`create_history_application` creates an `Application` instance that runs will
55
run as a sub application of the Repl/PythonInput.
66
"""
7+
78
from __future__ import annotations
89

910
from functools import partial

ptpython/ipython.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
offer.
99
1010
"""
11+
1112
from __future__ import annotations
1213

1314
from typing import Iterable

ptpython/layout.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Creation of the `Layout` instance for the Python input/REPL.
33
"""
4+
45
from __future__ import annotations
56

67
import platform

ptpython/python_input.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Application for reading Python input.
33
This can be used for creation of Python REPLs.
44
"""
5+
56
from __future__ import annotations
67

78
from asyncio import get_running_loop
@@ -98,8 +99,7 @@
9899
class _SupportsLessThan(Protocol):
99100
# Taken from typeshed. _T_lt is used by "sorted", which needs anything
100101
# sortable.
101-
def __lt__(self, __other: Any) -> bool:
102-
...
102+
def __lt__(self, __other: Any) -> bool: ...
103103

104104

105105
_T_lt = TypeVar("_T_lt", bound="_SupportsLessThan")

ptpython/repl.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
embed(globals(), locals(), vi_mode=False)
88
99
"""
10+
1011
from __future__ import annotations
1112

1213
import asyncio

ptpython/signatures.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
Either with the Jedi library, or using `inspect.signature` if Jedi fails and we
66
can use `eval()` to evaluate the function object.
77
"""
8+
89
from __future__ import annotations
910

1011
import inspect

ptpython/utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
For internal use only.
33
"""
4+
45
from __future__ import annotations
56

67
import re

pyproject.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.ruff]
22
target-version = "py37"
3-
select = [
3+
lint.select = [
44
"E", # pycodestyle errors
55
"W", # pycodestyle warnings
66
"F", # pyflakes
@@ -12,14 +12,14 @@ select = [
1212
"RUF100", # unused-noqa
1313
"Q", # quotes
1414
]
15-
ignore = [
15+
lint.ignore = [
1616
"E501", # Line too long, handled by black
1717
"C901", # Too complex
1818
"E722", # bare except.
1919
]
2020

2121

22-
[tool.ruff.per-file-ignores]
22+
[tool.ruff.lint.per-file-ignores]
2323
"examples/*" = ["T201"] # Print allowed in examples.
2424
"examples/ptpython_config/config.py" = ["F401"] # Unused imports in config.
2525
"ptpython/entry_points/run_ptipython.py" = ["T201", "F401"] # Print, import usage.
@@ -30,6 +30,6 @@ ignore = [
3030
"tests/run_tests.py" = ["F401"] # Unused imports.
3131

3232

33-
[tool.ruff.isort]
33+
[tool.ruff.lint.isort]
3434
known-first-party = ["ptpython"]
3535
known-third-party = ["prompt_toolkit", "pygments", "asyncssh"]

0 commit comments

Comments
 (0)