首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何确保vscode-python正确显示来自“flake8-rst-docstrings`”和/或“flake8-Black‘flake8扩展的linter条目?

如何确保vscode-python正确显示来自“flake8-rst-docstrings`”和/或“flake8-Black‘flake8扩展的linter条目?
EN

Stack Overflow用户
提问于 2019-01-23 00:16:49
回答 1查看 1.9K关注 0票数 2

与其他一些flake8扩展(例如:flake8-rst-docstrings)相反,flake8-rst-docstringsflake8-black输出代码有3个字母字符,而不是1 (RST299BLK100D204),这似乎阻止vscode-pythonvscode的PROBLEMS选项卡中显示这些条目。

对于以下代码段:

代码语言:javascript
运行
复制
from collections import \
    namedtuple, \
    deque

class ControlAlgoCoreSimpleSlots:
    """My non pydocstring compliant
    summary which should make `flake8-docstrings` bark.

    Here's some markdown code block (non valid sphinx syntax
    which should make `flake8-rst-docstrings` bark.

    ```
    def my_blocking_closure_fn():
        return long_blocking_call_on(my_argument_data)
    return self.make_blocking_job(my_blocking_closure_fn)
    ```
    """
    pass

flake8报告:

代码语言:javascript
运行
复制
$ flake8 '--format=%(row)d,%(col)d,%(code).1s,%(code)s:%(text)s' ./mymodule.py
1,1,F,F401:'collections.namedtuple' imported but unused
1,1,F,F401:'collections.deque' imported but unused
1,1,D,D100:Missing docstring in public module
1,25,B,BLK100:Black would make changes.
5,1,E,E302:expected 2 blank lines, found 1
6,1,D,D204:1 blank line required after class docstring
6,1,D,D205:1 blank line required between summary line and description
6,1,D,D400:First line should end with a period
12,1,R,RST299:Inline literal start-string without end-string.
14,1,R,RST301:Unexpected indentation.
15,1,R,RST201:Block quote ends without a blank line; unexpected unindent.
15,1,R,RST299:Inline literal start-string without end-string.
15,1,R,RST299:Inline interpreted text or phrase reference start-string without end-string.

当vscode缺少RSTBLK条目时。请参考vscode-python/issues/4074获得vscode输出的图像,因为我不允许在这里发布它。

我礼貌地在vscode-python上报道了vscode-python,然而,这个d3r3kk的家伙却突然解决了这个问题,没有具体解决我的问题。

有人能帮我设置vscode-python,这样我就可以获得所有的linter条目,包括来自flake8-rst-docstringsflake8-black的链接条目吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-02-19 16:27:29

您对https://github.com/Microsoft/vscode-python/issues/4074完全正确--这是vscode中的一个bug,而且您的修复看起来是明智的。我也在那评论过。

较长的代码反映了flake8 v3,http://flake8.pycqa.org/en/latest/plugin-development/registering-plugins.html的变化。

请注意:在Flake8 3.0中,您的入口点不需要精确为4个字符。考虑使用一个入口点,其中有3个字母,后面跟着3个数字(即ABC123 )。

最初的一个字母和三个数字的约定导致了许多flake8插件代码的冲突。

信息披露:“flake8-rst-docstringsflake8-black”的作者-感谢您的尝试!https://github.com/peterjc/flake8-rst-docstrings https://github.com/peterjc/flake8-black

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/54318303

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档