How do I create a pylintrc file

核能气质少年 提交于 2019-11-26 15:39:50

问题


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?


回答1:


You may put it in:

  • /etc/pylintrc for default global configuration
  • ~/.pylintrc for default user configuration
  • <your project>/pylintrc for default project configuration (used when you'll run pylint <your project>)
  • wherever you want, then use pylint --rcfile=<wherever I want>

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.




回答2:


According to documentation here, we can use the following command to generate a pylint rc file with all its options present:

pylint --generate-rcfile > ~/.pylintrc

The above command will create the file .pylintrc under your home directory. Then you can tweak the rc file to fit your needs.



来源:https://stackoverflow.com/questions/22448731/how-do-i-create-a-pylintrc-file

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