Skip to content

better doc on excluding files in pyproject.toml #13883

@copdips

Description

@copdips

Documentation

hello,

Could anyone provide a better doc about the exculde section in the pyproject.toml file ?

Current doc says:

[tool.mypy]
python_version = "2.7"
warn_return_any = true
warn_unused_configs = true
exclude = [
    '^file1\.py$',  # TOML literal string (single-quotes, no escaping necessary)
    "^file2\\.py$",  # TOML basic string (double-quotes, backslash and other characters need escaping)
]

IMHO, it's not very clear, at least, it should explain what kind of files are exclude by the syntax of '^file1\.py$', and what for "^file2\\.py$". And is it for any file with the same name under any folder ?
In addition, could you please provide an example how to exclude by a file path keywork. Suppose i have some files located at : /a/b/c/file.py, I would like to exclude all files where their location has the keywork /c/, how to achieve that.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions