Skip to content

Commit 0aa36c9

Browse files
committed
Add blurb in documentation for
1 parent 37d6933 commit 0aa36c9

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

doc/user_guide/features/formatting_code/index.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ experience across projects.
1818
Nox sessions
1919
++++++++++++
2020

21+
.. note::
22+
To prevent Python files from being formatted, you can do one of the following:
23+
* For a single file, use a comment in the files as described in :ref:`this table <prevent_auto_format>`.
24+
* If it is a directory (i.e. ``.workspace``), then you can exclude it by
25+
adding it to the ``add_to_excluded_python_paths`` in the project's ``Config``
26+
defined in the ``noxconfig.py``.
27+
2128
For autoformatting, the following tools are used:
2229

2330
* `black <https://black.readthedocs.io/en/stable/the_black_code_style/index.html>`__ -

doc/user_guide/features/formatting_code/troubleshooting.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ you receive an error from ``project:format`` (i.e. ``isort`` or ``black``), it i
1515
likely that you need to update your configuration to align with
1616
:ref:`formatting_configuration`.
1717

18+
.. _prevent_auto_format:
19+
1820
The automatic formatting is doing x, but we shouldn't do that because of y
1921
---------------------------------------------------------------------------
2022
Usually, automatic formatting is helpful, but there are rare cases where a developer

0 commit comments

Comments
 (0)