Skip to content

Commit

Permalink
Add OR regex example to --exclude docs (#10903)
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Nickedude and hauntsaninja authored Aug 1, 2021
1 parent 2c90912 commit 2c876d5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/source/command_line.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ for full details, see :ref:`running-mypy`.
For instance, to avoid discovering any files named `setup.py` you could
pass ``--exclude '/setup\.py$'``. Similarly, you can ignore discovering
directories with a given name by e.g. ``--exclude /build/`` or
those matching a subpath with ``--exclude /project/vendor/``.
those matching a subpath with ``--exclude /project/vendor/``. To ignore
multiple files / directories / paths, you can combine expressions with
``|``, e.g ``--exclude '/setup\.py$|/build/'``.

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

0 comments on commit 2c876d5

Please sign in to comment.