Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 14097

How to disable a subset of Pylint checks for modules matching a string or regex?

$
0
0

EDIT: Yes, it's easy to disable pylint entirely for certain files. That's not my question.

I know how to disable a check entirely:

disable = ["missing-module-doctring", ...]

But I'm trying to do the equivalent of this:

disable = [ {name="missing-module-docstring", glob="**/*/models.py"}, ...]

One example: We have many SQL Alchemy models.py files in our repo. It's obvious from our directory structure what the purpose of each models.py is. I'd really like to disable missing-module-docstring for any module x.y.z.models. A doc string will be superfluous noise. A per-file disable comment is about the same.

I have a few more scenarios like this for other checks and other module / python file naming conventions.

I looked through the config docs and didn't find anything. Is there a plugin that supports this?

If I have to go to the "two-pass solution", I guess I could run pylint once excluding models.py files. Then run it again filtering out everything butmodels.py?

For context: I run pylint at the command line, in CI, and in VS Code. I configure it in the project.toml but I'm open to changing this.


Viewing all articles
Browse latest Browse all 14097

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>