🎨 format code using black and isort

This commit is contained in:
yanyongyu
2021-11-22 23:21:26 +08:00
parent 602185a34e
commit a98d98cd12
86 changed files with 2893 additions and 2095 deletions

View File

@ -7,8 +7,7 @@ from nonebot.log import logger
def init():
driver = nonebot.get_driver()
try:
_module = importlib.import_module(
f"nonebot_plugin_docs.drivers.{driver.type}")
_module = importlib.import_module(f"nonebot_plugin_docs.drivers.{driver.type}")
except ImportError:
logger.warning(f"Driver {driver.type} not supported")
return
@ -18,8 +17,9 @@ def init():
port = driver.config.port
if host in ["0.0.0.0", "127.0.0.1"]:
host = "localhost"
logger.opt(colors=True).info(f"Nonebot docs will be running at: "
f"<b><u>http://{host}:{port}/docs/</u></b>")
logger.opt(colors=True).info(
f"Nonebot docs will be running at: " f"<b><u>http://{host}:{port}/docs/</u></b>"
)
init()

View File

@ -9,6 +9,4 @@ def register_route(driver: Driver):
static_path = str((Path(__file__).parent / ".." / "dist").resolve())
app.mount("/docs",
StaticFiles(directory=static_path, html=True),
name="docs")
app.mount("/docs", StaticFiles(directory=static_path, html=True), name="docs")

View File

@ -18,6 +18,21 @@ nonebot2 = "^2.0.0-alpha.1"
[tool.poetry.dev-dependencies]
[tool.black]
line-length = 88
target-version = ["py37", "py38", "py39"]
include = '\.pyi?$'
extend-exclude = '''
'''
[tool.isort]
profile = "black"
line_length = 80
length_sort = true
skip_gitignore = true
force_sort_within_sections = true
extra_standard_library = ["typing_extensions"]
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"