mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-07-16 11:00:54 +00:00
🎨 format code using black and isort
This commit is contained in:
@ -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()
|
||||
|
@ -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")
|
||||
|
@ -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"
|
||||
|
Reference in New Issue
Block a user