Skip to content

Commit

Permalink
Fix error in exclude section (#12078)
Browse files Browse the repository at this point in the history
Brings INI and TOML examples in line as noted.
  • Loading branch information
posita authored Jan 27, 2022
1 parent d5d077b commit a825c15
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions docs/source/config_file.rst
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,9 @@ section of the command line docs.
[tool.mypy]
exclude = [
"^file1\\.py$", # TOML's double-quoted strings require escaping backslashes
'^file2\.py$', # but TOML's single-quoted strings do not
"^one\.py$", # TOML's double-quoted strings require escaping backslashes
'two\.pyi$', # but TOML's single-quoted strings do not
'^three\.',
]
A single, multi-line string:
Expand All @@ -247,9 +248,10 @@ section of the command line docs.
[tool.mypy]
exclude = '''(?x)(
^file1\.py$
|^file2\.py$,
)'''
^one\.py$ # files named "one.py"
| two\.pyi$ # or files ending with "two.pyi"
| ^three\. # or files starting with "three."
)''' # TOML's single-quoted strings do not require escaping backslashes
See :ref:`using-a-pyproject-toml`.

Expand Down

0 comments on commit a825c15

Please sign in to comment.