VS Code Python Formatting: Change max line-length with autopep8 / yapf / black

Viewed 3654

I am experimenting with different python formatters and would like to increase the max line length. Ideally without editing the settings.json file. Is there a way to achieve that? select formatter

1 Answers

For all three formatters, the max line length can be increased with additional arguments passed in from settings, i.e.:

  • autopep8 args: --max-line-length=120
  • black args: --line-length=120
  • yapf args: --style={based_on_style: google, column_limit: 120, indent_width: 4}

Hope that helps someone in the future!

enter image description here

Related