Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ publish := uv publish --username=__token__ --keyring-provider=subprocess
test := $(run) pytest
python := $(run) python
ruff := $(run) ruff
lint := $(ruff) check --select I
lint := $(ruff) check
fmt := $(ruff) format
mypy := $(run) mypy
mkdocs := $(run) mkdocs
Expand Down
23 changes: 23 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,26 @@ explicit = true
venvPath="."
venv=".venv"
exclude=[".venv"]

[tool.ruff.lint]
select = [
# pycodestyle
"E",
# Pyflakes
"F",
# pyupgrade
"UP",
# flake8-bugbear
"B",
# flake8-simplify
"SIM",
# isort
"I",
]
ignore = [
# I think try...expect...pass reads far better.
"SIM105",
]

[tool.ruff.lint.pycodestyle]
max-line-length = 120
6 changes: 4 additions & 2 deletions src/textual_enhanced/commands/bindings.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
"""Provides helper code for dealing with bindings."""

##############################################################################
# Textual imports.
from typing import Iterator
# Python imports.
from collections.abc import Iterator

##############################################################################
# Textual imports.
from textual.app import App
from textual.binding import Binding
from textual.dom import DOMNode
Expand Down
3 changes: 2 additions & 1 deletion src/textual_enhanced/commands/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
##############################################################################
# Python imports.
from abc import abstractmethod
from collections.abc import Iterator
from functools import partial
from typing import Iterator, NamedTuple, TypeAlias
from typing import NamedTuple, TypeAlias

##############################################################################
# Rich imports.
Expand Down
11 changes: 9 additions & 2 deletions src/textual_enhanced/dialogs/help.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,16 @@ def input_help(self, node: DOMNode) -> str:
for binding in sorted(
helpful_bindings, key=attrgetter("most_helpful_description")
):
keys += f"{'| ' if commands else ''}| {self._table_safe(', '.join(all_keys_for(node, binding)))} | {binding.most_helpful_description} |\n"
keys += (
f"{'| ' if commands else ''}| "
f"{self._table_safe(', '.join(all_keys_for(node, binding)))} "
f"| {binding.most_helpful_description} |\n"
)
for command in sorted(commands, key=methodcaller("command")):
keys += f"| {command.command()} | {self._table_safe(', '.join(all_keys_for(node, command)))} | {command.tooltip()} |\n"
keys += (
f"| {command.command()} "
f"| {self._table_safe(', '.join(all_keys_for(node, command)))} | {command.tooltip()} |\n"
)
return f"\n\n{keys}"

@property
Expand Down
3 changes: 2 additions & 1 deletion src/textual_enhanced/screen.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

##############################################################################
# Python imports.
from collections.abc import Iterator
from contextlib import contextmanager
from typing import Generic, Iterator
from typing import Generic

##############################################################################
# Textual imports.
Expand Down
3 changes: 2 additions & 1 deletion src/textual_enhanced/tools/history.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
##############################################################################
# Python imports.
from collections import deque
from typing import Generic, Iterator, Sequence, TypeVar
from collections.abc import Iterator, Sequence
from typing import Generic, TypeVar

##############################################################################
# Textual imports.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_history.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

##############################################################################
# Python imports.
from typing import Sequence
from collections.abc import Sequence

##############################################################################
# Pytest imports.
Expand Down