Python PEP257-D212和D213冲突?

Python PEP257-D212和D213冲突?,python,Python,我试图在python文件之上的docstring上使用prospector 以下是我的docstring示例: """item_exporters.py contains Scrapy item exporters. Once you have scraped your items, you often want to persist or export those items, to use the data in some other application. That is, after

我试图在python文件之上的docstring上使用prospector

以下是我的docstring示例:

"""item_exporters.py contains Scrapy item exporters.

Once you have scraped your items, you often want to persist or export those items, to use the data in some other
application. That is, after all, the whole purpose of the scraping process.

For this purpose Scrapy provides a collection of Item Exporters for different output formats, such as XML, CSV or JSON.

More Info:
    https://doc.scrapy.org/en/latest/topics/exporters.html

"""
它有一个问题:

pep257: D213 / Multi-line docstring summary should start at the second line
因此,我向下移动第一行,它将从第二行开始:

"""
item_exporters.py contains Scrapy item exporters.

Once you have scraped your items, you often want to persist or export those items, to use the data in some other
application. That is, after all, the whole purpose of the scraping process.

For this purpose Scrapy provides a collection of Item Exporters for different output formats, such as XML, CSV or JSON.

More Info:
    https://doc.scrapy.org/en/latest/topics/exporters.html

"""
然后,如果我再次运行“浏览者”,我将得到D212作为一个错误

pep257: D212 / Multi-line docstring summary should start at the first line
D212和D213有什么问题吗

使用
忽略
标志:

--ignore=D212

根本原因:

正如@zachgates在公认的答案中指出的,问题在于两条相互排斥的规则。虽然他的解决方案适用于其他linter,但它并不能解决Prospector中的问题,Prospector不支持
--ignore
标志

浏览用户解决方案:

特别是对于“浏览者”,似乎没有一种命令行方式可以忽略单个规则。建议创建一个概要文件,但这对于我的用例来说不够便携

解决方法是从内置配置文件列表中选择一个默认配置文件

事实证明,名为
default
的配置文件足够聪明,不会试图捕获这两个互斥错误。我仍然不明白为什么“浏览者”默认为一种配置,而这种配置没有它自己的内置配置文件
default
的常识

解决方案:

如果使用“浏览”,这将解决您的问题:


--profile=default

嗯,这似乎有点奇怪。说“摘要行可能与开头的引号在同一行,也可能在下一行。”所以这两行都可以。@ChristianDean有没有办法看看D212和D213是不是最近添加的?看起来规则有冲突。啊,我只是在谷歌上快速搜索了一下。这似乎有点关联:。@ChristianDean是的,不知怎的,我没有通过谷歌找到这个问题。非常感谢!如果你愿意,你可以发布一个答案,我会接受的。Nvm,扎克抢先到了;-)只需选择他的.Prospector似乎不支持'--ignore'参数。我的问题和行动都是与探矿者。是否有一种特定于“浏览者”的方法可以在不创建专用“浏览者”配置文件的情况下完成此操作?记录为和