skip to Main Content

In vscode, if I put a comma in an element, it aligns vertically.
It seems to have happened since I installed black in Python.
css is also vertically aligned.
How do I put this exception?
For example, if about 80 characters are exceeded,
it would be good to move to the next line.

Python

alphabet = [
    "a",
    "b",
    "c",
    "d",
    "e",
    "f",
    "g",
    "h",
    "i",
    "j",
    "k",
    "l",
    "m",
    "n",
    "o",
    "p",
    "q",
    "r",
    "s",
    "t",
    "u",
    "v",
    "w",
    "x",
    "y",
    "z",
    "a",
    "b",
    "c",
    "d",
    "e",
    "f",
    "g",
    "h",
    "i",
    "j",
    "k",
    "l",
    "m",
    "n",
    "o",
    "p",
    "q",
    "r",
    "s",
    "t",
    "u",
    "v",
    "w",
    "x",
    "y",
    "z",
]

CSS

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: "Montserrat";
}

2

Answers


  1. Check your VS Code extensions for prettier-code formatter.
    If it is enabled then disable it. Prettier is an opinionated code formatter and is adding whitespace to your selector list as this is a convention for CSS selector lists.

    Login or Signup to reply.
  2. Adding the following code to your settings.json:

    "python.formatting.blackArgs": [
        "max-line-length:1000"
    ]
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search