Skip to content

Commit a825c15

Browse files
authored
Fix error in exclude section (#12078)
Brings INI and TOML examples in line as noted.
1 parent d5d077b commit a825c15

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

docs/source/config_file.rst

+7-5
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,9 @@ section of the command line docs.
237237
238238
[tool.mypy]
239239
exclude = [
240-
"^file1\\.py$", # TOML's double-quoted strings require escaping backslashes
241-
'^file2\.py$', # but TOML's single-quoted strings do not
240+
"^one\.py$", # TOML's double-quoted strings require escaping backslashes
241+
'two\.pyi$', # but TOML's single-quoted strings do not
242+
'^three\.',
242243
]
243244
244245
A single, multi-line string:
@@ -247,9 +248,10 @@ section of the command line docs.
247248
248249
[tool.mypy]
249250
exclude = '''(?x)(
250-
^file1\.py$
251-
|^file2\.py$,
252-
)'''
251+
^one\.py$ # files named "one.py"
252+
| two\.pyi$ # or files ending with "two.pyi"
253+
| ^three\. # or files starting with "three."
254+
)''' # TOML's single-quoted strings do not require escaping backslashes
253255
254256
See :ref:`using-a-pyproject-toml`.
255257

0 commit comments

Comments
 (0)