lat*_*sha 34 pep8 visual-studio-code
如何在Visual Studio代码中抑制pep8警告?我想要做的是抑制E501警告我不希望得到警告我的代码长度超过80个字符.我正在使用Don Jayamanne的Python扩展,这是我的vscode配置文件
{
"python.linting.pylintEnabled": false,
"python.linting.pep8Enabled": true,
"python.pythonPath": "/workspace/virtualenvs/abr/bin/python3",
"python.linting.enabled": true
}
Run Code Online (Sandbox Code Playgroud)
我知道还有另外一个选项"python.linting.pep8Args":[]但是我无法让它工作.我在virtualenv上安装了pep8
我已经尝试过的.
jcr*_*ada 65
将setup.cfg用于单个项目或更改所有py文件的用户设置.
{
"python.linting.pycodestyleEnabled": true,
"python.linting.pycodestyleArgs": [
"--ignore=E501"
]
}
Run Code Online (Sandbox Code Playgroud)
man*_*nda 23
如果要更改行长度,请在"用户设置"文件中添加
{
"python.linting.pep8Enabled": true,
"python.linting.pep8Args": ["--max-line-length=120" ]
}
Run Code Online (Sandbox Code Playgroud)
以前的代码给了我'EOF'
错误,所以我编辑了它
小智 15
几个星期前,我正在与此作斗争.我最终做的是将一个setup.cfg
文件添加到我的项目的根文件夹中并将以下内容放入其中:
[pep8]
ignore = E501
Run Code Online (Sandbox Code Playgroud)
这对我有用:
"python.linting.flake8Enabled": true,
"python.linting.flake8Args": ["--ignore=E501"]
Run Code Online (Sandbox Code Playgroud)
忽略多个 pycodestyle 警告:
{
"python.linting.pycodestyleEnabled": true,
"python.linting.pycodestyleArgs": [
"--ignore=E501,W503"
]
}
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
19255 次 |
最近记录: |