File tree 3 files changed +12
-10
lines changed
3 files changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -197,18 +197,19 @@ section of the command line docs.
197
197
198
198
.. confval :: exclude
199
199
200
- :type: newline separated list of regular expressions
200
+ :type: regular expressions
201
201
202
- A newline list of regular expression that matches file names, directory names and paths
202
+ A regular expression that matches file names, directory names and paths
203
203
which mypy should ignore while recursively discovering files to check.
204
204
Use forward slashes on all platforms.
205
205
206
206
.. code-block :: ini
207
207
208
208
[mypy]
209
- exclude =
209
+ exclude = (?x)(
210
210
^file1\.py$
211
- ^file2\.py$
211
+ |^file2\.py$
212
+ )
212
213
213
214
For more details, see :option: `--exclude <mypy --exclude> `.
214
215
@@ -997,8 +998,8 @@ of your repo (or append it to the end of an existing ``pyproject.toml`` file) an
997
998
warn_return_any = true
998
999
warn_unused_configs = true
999
1000
exclude = [
1000
- '^file1\.py$', # TOML single-quoted string (no escaping necessary)
1001
- "^file2\\.py$", # TOML double-quoted string (backslash needs escaping)
1001
+ '^file1\.py$', # TOML literal string (single quotes, no escaping necessary)
1002
+ "^file2\\.py$", # TOML basic string (double quotes, backslash and other characters need escaping)
1002
1003
]
1003
1004
1004
1005
# mypy per-module options:
Original file line number Diff line number Diff line change @@ -132,7 +132,7 @@ def check_follow_imports(choice: str) -> str:
132
132
'cache_dir' : expand_path ,
133
133
'python_executable' : expand_path ,
134
134
'strict' : bool ,
135
- 'exclude' : lambda s : [p . strip () for p in s . split ( ' \n ' ) if p .strip ()],
135
+ 'exclude' : lambda s : [s .strip ()],
136
136
}
137
137
138
138
# Reuse the ini_config_types and overwrite the diff
Original file line number Diff line number Diff line change @@ -1354,9 +1354,10 @@ b/bpkg.py:1: error: "int" not callable
1354
1354
# cmd: mypy .
1355
1355
[file mypy.ini]
1356
1356
\[mypy]
1357
- exclude =
1358
- abc
1359
- b
1357
+ exclude = (?x)(
1358
+ ^abc/
1359
+ |^b/
1360
+ )
1360
1361
[file abc/apkg.py]
1361
1362
1()
1362
1363
[file b/bpkg.py]
You can’t perform that action at this time.
0 commit comments