Skip to content

Commit cc181c0

Browse files
committed
Clean up from self-review
1 parent 47387b9 commit cc181c0

File tree

5 files changed

+35
-23
lines changed

5 files changed

+35
-23
lines changed

doc/faq.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
:octicon:`question` FAQ
44
=======================
55

6-
76
.. _faq_no_module_noxconfig:
87

98
No Module Named 'noxconfig'
@@ -16,5 +15,3 @@ There are several methods to configure your shell:
1615
1. For a one-time setup: :code:`PYTHONPATH=\`pwd\` nox -s task`
1716
2. For a general setup: :code:`export PYTHONPATH=`pwd``
1817
3. Alternatively, tools like `direnv <https://direnv.net>`_ can be used.
19-
20-
.. _faq_failing_format_check:

doc/user_guide/features/formatting_code/index.rst

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
.. _formatting_code:
22

3-
43
Formatting code
54
===============
65

@@ -9,19 +8,25 @@ Formatting code
98

109
troubleshooting
1110

12-
The PTB allows you to automatically format your code and to ensure via a step in the
13-
``checks.yml`` GitHub workflow that your committed code adheres to these standards. The
14-
goals of this are to improve the readability and maintainability of your code and to
15-
provide a uniform experience across projects.
11+
The PTB automatically formats code and ensures via a step in the ``checks.yml`` GitHub
12+
workflow that committed code adheres to these standards. The goals of this are to
13+
improve the readability and maintainability of the code and to provide a uniform
14+
experience across projects.
15+
16+
.. _formatting_sessions:
1617

1718
Nox sessions
1819
++++++++++++
1920

20-
For autoformatting, we use the following tools:
21+
For autoformatting, the following tools are used:
2122

22-
* `black` - automatically formats Python code to maintain consistent styling standards.
23-
* `isort`
24-
* `pyupgrade`
23+
* `black <https://black.readthedocs.io/en/stable/the_black_code_style/index.html>`__ -
24+
formats Python code to maintain consistent styling standards.
25+
* `isort <https://pycqa.github.io/isort/index.html>`__ - organizes and formats Python
26+
import statements alphabetically and by type (from __future__, standard library
27+
packages, third party packages, and local application imports).
28+
* `pyupgrade <https://pypi.org/project/pyupgrade/>`__ - upgrades syntax for newer
29+
versions of the Python language.
2530

2631
In the PTB, these tools are bundled into nox sessions to ensure that they are run in a
2732
deterministic manner.
@@ -40,6 +45,8 @@ deterministic manner.
4045

4146
.. _formatting_configuration:
4247

48+
TODO
49+
4350
Configuration
4451
+++++++++++++
4552
black
@@ -52,6 +59,9 @@ Your ``black`` configuration should look similar to this:
5259
:start-at: [tool.black]
5360
:end-before: [tool.isort]
5461

62+
For further configuration options, see
63+
`black configuration <https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html#configuration-format>`__.
64+
5565
isort
5666
^^^^^
5767
Ensure ``isort`` is configured with compatibility for ``black``:
@@ -61,6 +71,14 @@ Ensure ``isort`` is configured with compatibility for ``black``:
6171
:start-at: [tool.isort]
6272
:end-before: [tool.pylint.master]
6373

74+
For further configuration options, see
75+
`isort options <https://pycqa.github.io/isort/docs/configuration/options.html>`__.
76+
6477
pyupgrade
6578
^^^^^^^^^
6679
No initial configuration of ``pyupgrade`` is required.
80+
81+
For individual configuration, see the
82+
`pyupgrade CLI options <https://pypi.org/project/pyupgrade/>`__. These can
83+
be passed to the :ref:`formatting_sessions` via the ``pyupgrade_args``
84+
attribute of the :class:`noxconfig.Config`.

doc/user_guide/features/formatting_code/troubleshooting.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
Troubleshooting
22
===============
33

4-
54
Formatting still fails after running ``project:fix``
65
----------------------------------------------------
76

doc/user_guide/getting_started.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Install all necessary project and development dependencies for the project:
6969
7070
**4. Start using your project**
7171

72-
List all available nox tasks:
72+
List all available nox sessions:
7373

7474
.. code-block:: shell
7575
@@ -115,10 +115,10 @@ For further reference, see the specific configurations for:
115115
* :ref:`formatting code <formatting_configuration>`
116116

117117

118-
4. Make the toolbox tasks available
119-
+++++++++++++++++++++++++++++++++++
120-
To use the standard toolbox task via nox, just import them in your ``noxfile.py``.
121-
If you only need the standard tasks provided by the toolbox, your ``noxfile.py`` is
118+
4. Make the toolbox sessions available
119+
++++++++++++++++++++++++++++++++++++++
120+
To use the standard toolbox session via nox, just import them in your ``noxfile.py``.
121+
If you only need the standard sessions provided by the toolbox, your ``noxfile.py`` is
122122
straightforward, and you just can use the example ``noxfile.py`` below.
123123

124124
.. literalinclude:: ../../project-template/{{cookiecutter.repo_name}}/noxfile.py
@@ -127,7 +127,7 @@ straightforward, and you just can use the example ``noxfile.py`` below.
127127

128128
.. attention::
129129

130-
Keep in mind that the current path may not be included in the :code:`PYTHONPATH`, depending on the operating system you are using. This is explained in more detail in this resource: https://fedoraproject.org/wiki/Changes/PythonSafePath. Thus, it might be necessary to properly set the :code:`PYTHONPATH` before running nox. This is because our nox tasks expect the `noxconfig` module to be located within the python path.
130+
Keep in mind that the current path may not be included in the :code:`PYTHONPATH`, depending on the operating system you are using. This is explained in more detail in this resource: https://fedoraproject.org/wiki/Changes/PythonSafePath. Thus, it might be necessary to properly set the :code:`PYTHONPATH` before running nox. This is because our nox sessions expect the `noxconfig` module to be located within the python path.
131131

132132
For additional information on resolving this issue, please :ref:`refer to <faq_no_module_noxconfig>`.
133133

@@ -136,7 +136,7 @@ straightforward, and you just can use the example ``noxfile.py`` below.
136136

137137
#. Add a :code:`.pre-commit-config.yaml` file to your project root
138138

139-
If you want to reuse Nox tasks in the pre-commit hooks, feel free to get some inspiration from the Python toolbox itself:
139+
If you want to reuse Nox sessions in the pre-commit hooks, feel free to get some inspiration from the Python toolbox itself:
140140

141141
.. literalinclude:: ../../project-template/{{cookiecutter.repo_name}}/.pre-commit-config.yaml
142142
:language: yaml
@@ -163,4 +163,4 @@ Look at the configuration of Sonar for a:
163163

164164
8. Go 🥜
165165
+++++++++++++
166-
You are ready to use the toolbox. With ``nox -l`` you can list all available tasks.
166+
You are ready to use the toolbox. With ``nox -l`` you can list all available sessions.

doc/user_guide/migrating.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ As a first step, it is generally advisable to introduce `Nox`_ as a task runner
3232
-----------------------------------
3333
This can be done incrementally for different checks of your project, such as *project*, *test*, *linting*, *documentation*, and *other* tasks.
3434
As the tasks can be split into roughly five groups, it likely makes sense to integrate at least one group at a time.
35-
For more details on the current tasks and groups, refer to: :ref:`toolbox tasks`.
36-
3735

3836
Overloading a Task
3937
__________________

0 commit comments

Comments
 (0)