🔧 添加格式化工具 black 的配置

This commit is contained in:
Karako 2022-10-08 23:03:11 +08:00 committed by GitHub
parent 52de48fedf
commit 638fe509b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 3 deletions

View File

@ -4,6 +4,7 @@
<img src="https://img.shields.io/badge/python-3.8%2B-blue">
<img src="https://img.shields.io/badge/works%20on-my%20machine-brightgreen">
<img src="https://img.shields.io/badge/status-%E5%92%95%E5%92%95%E5%92%95-blue">
<a href="https://black.readthedocs.io/en/stable/index.html"><img src="https://img.shields.io/badge/code%20style-black-000000.svg" alt="code_style" /></a>
<a href="https://www.codacy.com/gh/luoshuijs/TGPaimonBot/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=luoshuijs/TGPaimonBot&amp;utm_campaign=Badge_Grade"><img src="https://app.codacy.com/project/badge/Grade/810a80be4cbe4b7284ab7634941423c4"/></a>
</div>

View File

@ -41,6 +41,11 @@ pyro = ["Pyrogram", "TgCrypto"]
test = ["pytest", "pytest-asyncio", "flaky"]
all = ["pytest", "pytest-asyncio", "flaky", "Pyrogram", "TgCrypto"]
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
# pytest配置
[tool.pytest.ini_options]
asyncio_mode = "auto"
log_cli = true
@ -48,6 +53,8 @@ log_cli_level = "INFO"
log_cli_format = "%(message)s"
log_cli_date_format = "%Y-%m-%d %H:%M:%S"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
# 格式配置
[tool.black]
include = '\.pyi?$'
line-length = 120
target-version = ['py38', 'py39', 'py310']