Pylint: Disable specific warnings for specific folder

无人久伴 提交于 2019-12-03 05:59:59

As far as I'm aware you can't disable specific warnings for entire directories or files.

However, you can disable all warnings for specific directories using the following on the command line:

--ignore=<file[,file]>

The file here can be a directory.

Personally, and I know you said you'd rather not, I'd add a disable to the top of each file.

Yes, you can create .pylintrc in the tests folder, and another in the project folder.

Add tests to the "ignore" section of the project

[MASTER]
ignore=tests

See: https://docs.pylint.org/en/1.6.0/run.html

Then run separately:

pylint project
pylint project/tests
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!