【问题标题】:vim-flake8 started showing D and H errorsvim-flake8 开始显示 D 和 H 错误
【发布时间】:2016-02-13 21:41:06
【问题描述】:

我在vim中遇到了pyflake8的问题,他开始显示一些他根本没有显示的错误,像这样:

models.py|1 col 1| D100  Missing docstring in public module
models.py|2 col 1| H306  imports not in alphabetical order (django.db.models, django.contrib.auth.models.user)
models.py|6 col 1| D204  1 blank line required after class docstring (found 0)
models.py|6 col 1| D205  1 blank line required between summary line and description (found 0)
models.py|6 col 1| D209  Multi-line docstring closing quotes should be on a separate line
models.py|6 col 1| D211  No blank lines allowed before class docstring (found 1)
models.py|9 col 1| H405  multi line docstring summary not separated with an empty line
models.py|9 col 53| H403  multi line docstrings should end on a new line
models.py|14 col 1| D210  No whitespaces allowed surrounding docstring text
models.py|14 col 1| D400  First line should end with a period (not '!')

我认为这些是一些标准的 pep8 错误,但是 pyflakes8 直到今天我对其进行升级时才显示它们。当前版本2.5.4 (pep8: 1.7.0, mccabe: 0.4.0, pep257: 0.2.1.post1, pyflakes: 1.0.0, hacking.core: 0.0.1, ProxyChecker: 0.0.1) CPython 2.7.6 on Linux 我这样做是因为 vim 显示 pyflake 不工作的错误,升级后 pyflake 工作但它开始显示这个 D 和 H 错误,如何解决这种情况?

【问题讨论】:

  • 您不想看到这些错误吗?

标签: python vim vim-plugin pyflakes


【解决方案1】:

vim-flake8 使用标准的 flake8 配置文件~/.config/flake8,可以像这个例子一样从docs 进行配置。

The user settings are read from the ~/.config/flake8 file 
(or the ~/.flake8 file on Windows). Example:

[flake8]
ignore = E226,E302,E41
max-line-length = 160
exclude = tests/*
max-complexity = 10

这看起来像是changed recently

【讨论】:

  • 这就是问题所在,是的,这就是我想要找到的东西
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-05-15
  • 1970-01-01
  • 2013-06-07
  • 2012-03-23
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多