Pylint- Pylintrc文档在哪里?
指定适合您的设置和编码标准的所有选项可能很乏味,因此可以使用配置文件指定默认值。您可以使用-rcfile选项在命令行上指定配置文件。否则,Pylint按以下顺序搜索配置文件,并使用它所找到的第一个文件:
放置MAX-LINE-LENGTH,但抱怨没有部分。如何格式化PylIntrc文件的文档在哪里?
〜/.pylintrc
max-line-length=120
Specifying all the options suitable for your setup and coding standards can be tedious, so it is possible to use a configuration file to specify the default values. You can specify a configuration file on the command line using the --rcfile option. Otherwise, Pylint searches for a configuration file in the following order and uses the first one it finds:
Place the max-line-length but it complains there is no section. Where is the documentation of how to format the pylintrc file?
~/.pylintrc
max-line-length=120
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
因此,似乎没有专门用于制作
.pylintrc
文件的文档。但是,通过对文档和我自己的故障排除的一些交叉引用,我认为我理解了这种格式。您需要查看 Checkers 页面。配置选项将分为几节,例如主要的检查器,基本检查器等。要在
.pyntrc
文件中设置一个选项,它必须在与Checker类型相对应的部分标题下。然后在没有领先连字符的情况下输入选项。以下是我创建的最小
.pylintrc
文件的示例。选项disable
,Extension-pkg-allow-list
和source-roots
在主检查程序下[MAIN]
。选项const-namingStyle
在基本检查器下,因此我将其放在标题[basic]
的部分中。这就是我发现有效的东西。最坏的情况,您将必须使用
Pylint-generate-rcfile
生成默认配置文件,然后从那里弄清楚它。So it appears there is no documentation specifically for making
.pylintrc
files. But through some cross referencing of the documentation and my own troubleshooting, I think I understand the format.You need to look at the Checkers page. The config options will be grouped into sections such as Main checkers, Basic checkers, etc. To set an option in a
.pylintrc
file, it must be under a section header corresponding to the type of checker. Then enter the option without the leading hyphens.Below is an example of a minimal
.pylintrc
file I created. The optionsdisable
,extension-pkg-allow-list
, andsource-roots
were under Main Checker so I put them in the section with header[MAIN]
. The optionconst-namingstyle
is under Basic Checker so I put it in the section with header[BASIC]
.This is what I found works. Worst case, you will have to generate a default config file with
pylint --generate-rcfile
and figure it out from there.请使用不需要部分的最新版本的Pylint。配置文档为在
这里href =“ https://pylint.pycqa.org/en/latest/faq.html?highlight = genereser%20configuration#how-do-i-i-find-the-name-name-corresport-the-name-corresporting to-a to-a to-a to to to to to a to a a -option“ rel =” nofollow noreferrer”>自动生成配置文件:
在实践中,它通常是最好创建最小配置文件,该文件仅包含配置覆盖。对于所有其他选项,Pylint将使用其默认值。
Please use the latest version of pylint where no sections are required. The configuration documentation is here
You can generate a configuration file automatically:
In practice, it is often better to create a minimal configuration file which only contains configuration overrides. For all other options, Pylint will use its default values.