本文介绍了如何创建 pylintrc 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在运行Linux.我可以做一些类似 pylint --generate-rcfile > 的事情吗?.pylintrc
然后更改生成的 .pylintrc
文件以覆盖默认设置?如果是这样,它应该在我的 ~/
目录中还是应该放在 .pylint.d 中?
I am running linux. Can I do something like pylint --generate-rcfile > .pylintrc
and then make changes to the resulting .pylintrc
file to override the default settings? And if so should it be in my ~/
directory or should I put it in .pylint.d?
推荐答案
你可以把它放在:
/etc/pylintrc
用于默认全局配置~/.pylintrc
用于默认用户配置/pylintrc
用于默认项目配置(在运行pylint
时使用)- 任何你想要的地方,然后使用
pylint --rcfile=
/etc/pylintrc
for default global configuration~/.pylintrc
for default user configuration<your project>/pylintrc
for default project configuration (used when you'll runpylint <your project>
)- wherever you want, then use
pylint --rcfile=<wherever I want>
还要注意在生成rc文件的时候,可以在命令行的--generate-rcfile
之前添加选项,它们会在生成的文件中被考虑.
Also notice when generating the rc file, you may add option on the command line before the --generate-rcfile
, they will be considered in the generated file.
这篇关于如何创建 pylintrc 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!