jorgmo02
jorgmo02

Reputation: 41

MyPy configuration - exclude subdirectories with matching name

I'm trying to exclude some directories at my mypy.ini file by using the exclude option. The directories I'm trying to exclude match the format */test/*, being * any amount of subdirectories (can be none).

For example, I can have the following structure, where I'd like to exclude all folders named test regardless of where they are:

src/
├── foo/
│   ├── test/
│   |   └── a_test
│   └── foofile
└── test/
    └── another_test

I thought that I could use regular expressions in order to match these folders, and I tried some regex but none seem to work.

Can I get some help with this? Essentially, what I want to have is something like this:

[mypy]
exclude = "<anything>/test/"

Where I don't know how to specify the <anything> part.

Upvotes: 0

Views: 1093

Answers (1)

DeepSpace
DeepSpace

Reputation: 81664

Since you want to exclude all dirs called test, you don't need a regex at all:

[mypy]
exclude=test

Upvotes: 2

Related Questions