Skip to content

Commit d2bcb73

Browse files
committed
Adapt documentation to be more explicit and fix reference
1 parent 801fcb7 commit d2bcb73

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

doc/user_guide/features/formatting_code/index.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,10 @@ For autoformatting, the following tools are used:
2727
packages, third party packages, and local application imports).
2828
* `pyupgrade <https://pypi.org/project/pyupgrade/>`__ - upgrades syntax for newer
2929
versions of the Python language.
30-
* `ruff <https://docs.astral.sh/ruff/>`__ - checks and fixes code per its configuration.
31-
Currently, the PTB only supports removing unused imports.
30+
* `ruff <https://docs.astral.sh/ruff/>`__ - includes a plethora of tools to check and
31+
automatically format code. In the PTB, only the following checks are active:
32+
33+
* `unused-import (F401) <https://docs.astral.sh/ruff/rules/unused-import/>`__ - removes unused imports
3234

3335
In the PTB, these tools are bundled into nox sessions to ensure that they are run in a
3436
deterministic manner.
@@ -91,7 +93,7 @@ Ensure ``ruff`` is configured like so:
9193

9294
.. literalinclude:: ../../../../project-template/{{cookiecutter.repo_name}}/pyproject.toml
9395
:language: toml
94-
:start-at: [tool.ruff]
96+
:start-at: [tool.ruff.lint]
9597
:end-before: [tool.mypy.overrides]
9698

9799
For further configuration options, see

doc/user_guide/features/formatting_code/troubleshooting.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ might want to ignore automatically applied formatting.
3939
| | <line-to-ignore> # isort:skip| # isort:skip_file |
4040
+-----------------------+--------------------------------+-----------------------+
4141
| formatting from ruff | .. code-block:: python | .. code-block:: python|
42-
| | | |
42+
| (example with F401) | | |
4343
| | <line-to-ignore> # noqa: F401| # ruff: noqa F401 |
4444
+-----------------------+--------------------------------+-----------------------+
4545

0 commit comments

Comments
 (0)