[PYTHON] I introduced black to vscode, but it doesn't autoformat

Introduction

Black that doesn't work at all. Why is that?

Checkpoint

  1. Is python 3.6 or later?
  2. Are you making the appropriate settings?
  3. Is the option attached incorrectly?

I was addicted to number 3. After all it is not good to change various things suddenly ...

settings.json


    "[python]": {
        "editor.tabSize": 4,
        "editor.detectIndentation": false,
        "editor.formatOnSave": true,
    },
    "python.linting.enabled":true,
    "python.linting.pylintEnabled": false,
    "python.linting.flake8Enabled": true,
    "python.linting.lintOnSave":true,
    "python.formatting.provider": "black",
    "python.linting.flake8Args": [
        "--max-line-length=120",
        "--ignore=E203,W503,W504"
      ],
    "python.formatting.blackArgs": [
        "--line-length=120"
      ],

The problem with automatic formatting not working was how to specify the maximum number of characters per line.

Recommended Posts

I introduced black to vscode, but it doesn't autoformat
I started, but it doesn't start!
When I try to push with heroku, it doesn't work
When I try to make Apache SSL, it doesn't start.
I want to do it with Python lambda Django, but I will stop
I want to tweet on Twitter with Python, but I'm addicted to it
I installed PySide2, but pyside2-uic didn't work, so I managed to do it.
I tried to install Docker on Windows 10 Home but it didn't work
The file edited with vim was readonly but I want to save it
I tried to use Java with Termux using Termux Arch but it didn't work
When I tried to make a VPC with AWS CDK but couldn't make it
When I connect to a remote Jupyter Server with VScode, it's remote but local
I tried my best to make an optimization function, but it didn't work.
[Introduction to json] No, I was addicted to it. .. .. ♬
I defined ForeignKey to CustomUser specified in AUTH_USER_MODEL in Django, but it is not referenced
I tried to scrape YouTube, but I can use the API, so don't do it.
"Amazon Dash Button" has landed in Japan, but I dared to make it myself