I have my unit tests living alongside my source code. i.e.
├── __init__.py
├── formatter.py
└── test_formatter.py
Is there a way to get Pylint to exclude all files prefixed with test_
from its analysis? The ignore
configuration option doesn't seem to like wildcards.
The solution was to include --disable=file-ignored in the Pylint command options.
This was introduced as a feature in Pylint 1.6 via the --ignore-patterns
option.
So, to ignore the files above:
pylint myproject --ignore-patterns=test_.*?py
there is indeed no wildcard support. You may submit a feature request or even better a pull-request on https://github.com/PyCQA/pylint
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With