我正在尝试使用flake8作为默认的python linter,在neovim v0.5上使用python-language-server。
python-lsp documentation建议将pylsp.configurationSources设置为['flake8'],但没有指定要编辑哪个文件。
此配置文件驻留在何处?
发布于 2021-10-25 10:13:32
根据flake8 documentation的说法,flake8配置的位置根据系统的不同而不同,在Linux和Mac上,它是~/.config/flake8,而对于Windows,它是$HOME\.flake8 ($HOME类似于C:\\Users\sigmavirus24)。内容应为INI格式:
[flake8]
max-line-length = 100
max-complexity = 30
ignore =
# missing whitespace around arithmetic operator
E226,
# line break before/after binary operator
W503,
W504,
# expected 1 blank line, found 0
E301,E302,要取消单个警告,还可以添加# noqa: F841-like (将代码更改为您想要使用的实际代码)注释字符串来取消该警告。
参考:https://jdhao.github.io/2020/11/05/pyls_flake8_setup/#config-location
https://stackoverflow.com/questions/69432979
复制相似问题