autopep8 vscode 插件配置

0x00

📝记录一下

0x01

使用 vscode 编写 python 代码的时候肯定是需要格式化的,于是安装了 autopep8 插件。

如何配置参数呢,在 .vscode/settings.json 中加入

1
2
3
4
5
{
"python.formatting.autopep8Args": [
"--ignore", "E402,E501"
]
}
1
2
E402 - Fix module level import not at top of file
E501 - Try to make lines fit within --max-line-length characters.

具体的参数参考 https://github.com/hhatto/autopep8#features

配置完成之后 ctrl + shift + f 就可以格式化代码啦😁

0x02

封面出处:http://simpledesktops.com/browse/desktops/2014/jun/03/bee-easy/

Author: ronething
Link: https://blog.ronething.cn/20190525-autopep8.html
Copyright Notice: All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.