VS Code how to disable pydocstyle linting in testing files?

Viewed 598

I'm currently working on a python project and decided to install pydocstyle to improve my documentation habits. However I don't want pydocstyle to lint my testing files and was wondering how I could create a pattern in settings.json to achieve that. Thanks

2 Answers

For example, your test files are prefixed by test_, you can add the following code in Settings.json:

"python.linting.ignorePatterns": [
    "test_*.py",
]

Then your test files are excluded from linting:

enter image description here

Finally found solution (but don't ask me why it works though :)

"python.linting.pydocstyleArgs": ["--match=^((?!test).)*$"],
Related