How to specify a configuration file for pylint under windows?

﹥>﹥吖頭↗ 提交于 2019-12-18 04:30:12

问题


I am evaluating pylint as source code checker and I would like to customize the maximum number of characters on a single line.

I would like to use a configuration file. I've generated a template thanks to the --generate-rcfile command and I've made my modification.

I am trying to run pylint --rcfile=myfile.rc but I can see that my changes are not taken into account by pylint. I've tried different location for my file : \Python26\Scripts\ and pylint.d in my user folder without any success.

Does anybody know what I am doing wrong?

Is it possible to use the configration file with pylint-gui? I can't do it too?


回答1:


On Windows 7, a .pylintrc file in your home directory (typically C:\Users\myusername) will be automatically recognized.

Since creating a file beginning with a dot is not allowed from Windows file explorer, you can create a template using:

pylint --generate-rcfile > .pylintrc



回答2:


Try setting PYLINTRC env variable.

I use batch:

@echo off
set PYLINTHOME=c:\tools
set PYLINTRC=c:\etc\pylint.conf
rem c:\Python27\python.exe c:\Python27\Lib\site-packages\pylint\lint.py %1 %2 %3 %4 %5 %6 %7 %8 %9
c:\Python27\python.exe c:\Python27\Lib\site-packages\pylint\lint.py %*


来源:https://stackoverflow.com/questions/1372295/how-to-specify-a-configuration-file-for-pylint-under-windows

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