Skip to content

Commit 2c876d5

Browse files
Add OR regex example to --exclude docs (#10903)
Adds an example on how to use the OR-operator to combine two regular expressions in order to ignore multiple file or directory names. Co-authored-by: Shantanu <[email protected]>
1 parent 2c90912 commit 2c876d5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docs/source/command_line.rst

+3-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ for full details, see :ref:`running-mypy`.
5858
For instance, to avoid discovering any files named `setup.py` you could
5959
pass ``--exclude '/setup\.py$'``. Similarly, you can ignore discovering
6060
directories with a given name by e.g. ``--exclude /build/`` or
61-
those matching a subpath with ``--exclude /project/vendor/``.
61+
those matching a subpath with ``--exclude /project/vendor/``. To ignore
62+
multiple files / directories / paths, you can combine expressions with
63+
``|``, e.g ``--exclude '/setup\.py$|/build/'``.
6264

6365
Note that this flag only affects recursive discovery, that is, when mypy is
6466
discovering files within a directory tree or submodules of a package to

0 commit comments

Comments
 (0)