[英]VS Code Python Formatting: Change max line-length with autopep8 / yapf / black
For all three formatters, the max line length can be increased with additional arguments passed in from settings, ie:对于所有三个格式化程序,可以通过从设置中传入额外的 arguments 来增加最大行长度,即:
--max-line-length=120
--max-line-length=120
--line-length=120
--line-length=120
--style={based_on_style: google, column_limit: 120, indent_width: 4}
--style={based_on_style: google, column_limit: 120, indent_width: 4}
Hope that helps someone in the future!希望将来能帮助别人!
@tkazik answered his own question correctly, however, I thought it would be helpful to include some references: @tkazik 正确回答了他自己的问题,但是,我认为包含一些参考资料会有所帮助:
VSCode documentation on using Python formatters:关于使用 Python 格式化程序的VSCode 文档:
https://code.visualstudio.com/docs/python/editing#_formatting https://code.visualstudio.com/docs/python/editing#_formatting
autopep8 command line options: autopep8命令行选项:
https://pypi.org/project/autopep8/#usage https://pypi.org/project/autopep8/#usage
black command line options:黑色命令行选项:
https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html#command-line-options https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html#command-line-options
yapf command line options: yapf命令行选项:
https://github.com/google/yapf#usage https://github.com/google/yapf#usage
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.