Skip to main content

Posts

Showing posts from November, 2017

Increasing Python maximum line length used by Visual Studio Code autoformat

Recently, I was struggling with setting the correct formatting options for Python code in Visual Studio Code. I added the option --max-line-length=180 to the python.linting.pylintArgs , without success. After some time I discovered that Pylint is used by Visual Studio Code by default for linting, and autopep8 for formatting. Simply adding the option --max-line-length=180 to python.formatting.autopep8Args solved the problem. Now both Pylint and autopep8 are in sync. Simply use the following user settings file for Visual Studio Code for all of this to work... { "python.linting.pylintArgs" : [ "--max-line-length=180" ], "python.formatting.autopep8Args" : [ "--max-line-length=180" ] }