Skip to content

how to exclude files using mypy.ini? #157

@nagyben

Description

@nagyben

I've defined an exclude pattern in mypy.ini to exclude test files

#mypy.ini
[mypy]
warn_return_any = True
warn_unused_configs = True
exclude = (?x)(test_.+py)
...

This works fine when I run mypy from the command line in the terminal e.g. mypy --config-file mypy.ini . but because the plugin runs mypy on specific files (the output window for the plugin runs it like python -m mypy ... [file_name]) this exclude pattern is ignored

Setting mypy-type-checker.args also doesn't work:

# settings.json
"mypy-type-checker.args": [
    "--exclude",
    "test"
]

What's the best way to exclude files?

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions