psf/black

Using Black Playground automatically adds a blank line after the comment. Using CMD does not automatically add this blank line, resulting in the comment being right next to the line of code below. So which one should I use?

Closed this issue · 2 comments

Black v24.10.0

Playground link

Options

--line-length=88
--safe

Input

import requests
import pandas as pd
from bs4 import BeautifulSoup
import re
import time
import random
import unicodedata
import emoji

# Đặt tiêu đề HTTP
headers = {
    "Accept": "*/*",
    "Accept-Encoding": "gzip, deflate, br, zstd",
    "Accept-Language": "vi-VN,vi;q=0.9",
    "Connection": "keep-alive",
    "DNT": "1",
    "Domain-Name": "phanmall.storee.vn",
    "Host": "web-api.storee.vn",
    "Origin": "https://phanmall.storee.vn",
    "Referer": "https://phanmall.storee.vn/",
    "Sec-Fetch-Dest": "empty",
    "Sec-Fetch-Mode": "cors",
    "Sec-Fetch-Site": "same-site",
    "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 16_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1",
}

Output

import requests
import pandas as pd
from bs4 import BeautifulSoup
import re
import time
import random
import unicodedata
import emoji

# Đặt tiêu đề HTTP

headers = {
    "Accept": "*/*",
    "Accept-Encoding": "gzip, deflate, br, zstd",
    "Accept-Language": "vi-VN,vi;q=0.9",
    "Connection": "keep-alive",
    "DNT": "1",
    "Domain-Name": "phanmall.storee.vn",
    "Host": "web-api.storee.vn",
    "Origin": "https://phanmall.storee.vn",
    "Referer": "https://phanmall.storee.vn/",
    "Sec-Fetch-Dest": "empty",
    "Sec-Fetch-Mode": "cors",
    "Sec-Fetch-Site": "same-site",
    "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 16_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1",
}

Expected

The Black playground is not maintained by the same team. It may have a bug here, but it should be reported on the playground's own bug tracker.

The Black playground is not maintained by the same team. It may have a bug here, but it should be reported on the playground's own bug tracker.

I clicked report issue and it was moved to github
image