简体   繁体   English

flake8 不支持全局配置。 埃尔比

[英]flake8 not honoring global configuration. elpy

I am new to emacs & trying to use it for python programming.我是 emacs 的新手,并试图将它用于 python 编程。 I have installed elpy & everything is working fine except one thing - I am getting lot of warnings, errors like E401, E402, E501 etc. All are in scary red colors.我已经安装了 elpy 并且一切正常,除了一件事 - 我收到了很多警告,错误,如 E401、E402、E501 等。所有都是可怕的红色。

After researching little bit, it looks like these errors are coming from flake8.经过一点研究,看起来这些错误来自 flake8。 So I configure flake8 as follows:所以我配置 flake8 如下:

In ~/.config/flake8,在 ~/.config/flake8 中,

[flake8]
ignore=E201,E203,E211,E221,E272,E251,E211,E222,E226,E228,E241,E301,E302,E401,E402,E501,E701,F401
max-line-length=160
exclude=tests/*
max-complexity=10

But still those errors are coming.但是这些错误仍然会出现。 I also configured same way PEP8 & pycodestyle in .config/ .我还在.config/以相同的方式配置了 PEP8 和 pycodestyle。 But no progress.但是没有任何进展。 I tried to put setup.cfg & tox.ini in project root, but that also didn't work.我试图将setup.cfgtox.ini放在项目根目录中,但这也不起作用。

For more information, there is similar ticket in sublime flake8 repo.有关更多信息,sublime flake8 repo 中有类似的票证。 https://github.com/SublimeLinter/SublimeLinter-flake8/issues/24 https://github.com/SublimeLinter/SublimeLinter-flake8/issues/24

Please let me know if there is any working solution or emacs hacks.请让我知道是否有任何可行的解决方案或 emacs hacks。

Following are some details以下是一些细节

Os - Linux Mint 17.3 Rosa
flake8 version - 3.0.0b1 (pyflakes: 1.2.3, pycodestyle: 2.0.0, mccabe: 0.5.0)
GNU Emacs 24.3.1

Thanks in advance.提前致谢。

Try restarting emacs. 尝试重新启动emacs。 For me it picks up ~/.config/flake8 when emacs is started, but doesn't pick it up between runs. 对我来说,启动emacs时会拾取〜/ .config / flake8,但在运行之间却不会拾取。

任何试图让flake8>=4.0.0运行的flake8>=4.0.0 ,那是因为不再支持全局配置文件,请参阅https://flake8.pycqa.org/en/latest/release-notes/4.0.0.html #backwards-incompatible-changes

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM