windows下如何为pylint指定配置文件?

发布于 2024-08-03 06:48:09 字数 295 浏览 4 评论 0原文

我正在评估 pylint 作为源代码检查器,我想自定义单行上的最大字符数。

我想使用配置文件。感谢 --generate-rcfile 命令,我生成了一个模板,并进行了修改。

我正在尝试运行 pylint --rcfile=myfile.rc 但我可以看到 pylint 没有考虑我的更改。我已经尝试了我的文件的不同位置: \Python26\Scripts\ 和 pylint.d 在我的用户文件夹中,但没有成功。

有人知道我做错了什么吗?

是否可以将配置文件与 pylint-gui 一起使用?我也做不到吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

烟酒忠诚 2024-08-10 06:48:09

在 Windows 7 上,将自动识别主目录(通常为 C:\Users\myusername)中的 .pylintrc 文件。

您可以使用以下方法创建模板:

pylint --generate-rcfile > .pylintrc

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

You can create a template using:

pylint --generate-rcfile > .pylintrc
沧桑㈠ 2024-08-10 06:48:09

尝试设置 PYLINTRC 环境变量。

我使用批处理:

@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 %*

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 %*
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文