Skip to content

exclude is COMPLETELY broken #11744

Closed
Closed
@chris1248

Description

@chris1248

Bug Report

Given that my source code is in directory src, and I want to ignore files in src/app/models I should be able to exclude that directory or files.
The docs:
https://mypy.readthedocs.io/en/stable/command_line.html?highlight=exclude#cmdoption-mypy-exclude
give directions that simply do not work.

To Reproduce

  1. call mypy --exclude /src/app/models/ src

Expected Behavior

I should see no files in src/app/models in the output of warnings/errors from mypy

Actual Behavior

I see LOTS Of files in src/app/models in the output of warnings/errors from mypy

Your Environment

  • Mypy version used: 0.910
  • Mypy configuration options from mypy.ini:
# Global section
[mypy]
python_version = 3.8
  • Python version used: 3.8.7
  • Operating system and version: Max OS 11.6

Attempted work arounds
I have similarly tried all sorts of attempts at the regex, with no success.
mypy --exclude /src/app/models/.*$ src
mypy --exclude /src/app/models$ src
exclude = 'src/app/models/$' (in the ini file)
Nothing works.
Don't you unit tests or integration tests for this stuff??

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmypy got something wrong

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions