🔨 添加ruffpre-commit

This commit is contained in:
Wuyi无疑 2023-02-16 00:11:46 +08:00
parent ec3fe28cc5
commit e4f83b92c4
3 changed files with 9 additions and 1 deletions

View File

@ -38,3 +38,7 @@ repos:
# - id: poetry-export # - id: poetry-export
# args: ["-f", "requirements.txt", "--without-hashes", "-o", "requirements.txt"] # args: ["-f", "requirements.txt", "--without-hashes", "-o", "requirements.txt"]
# verbose: true # verbose: true
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: 'v0.0.245'
hooks:
- id: ruff

View File

@ -35,4 +35,3 @@ async def websocket_endpoint(websocket: WebSocket, bot_id: str):
if __name__ == "__main__": if __name__ == "__main__":
uvicorn.run(app, host=HOST, port=PORT) uvicorn.run(app, host=HOST, port=PORT)
uvicorn.run(app, host=HOST, port=PORT)

View File

@ -21,6 +21,7 @@ black = "^22.12.0"
isort = "^5.11.4" isort = "^5.11.4"
pre-commit = "^2.21.0" pre-commit = "^2.21.0"
pycln = "^2.1.2" pycln = "^2.1.2"
ruff = "^0.0.245"
[build-system] [build-system]
requires = ["poetry-core"] requires = ["poetry-core"]
@ -34,6 +35,10 @@ skip-string-normalization = true
extend-exclude = ''' extend-exclude = '''
''' '''
[tool.ruff]
line-length = 79
target-version = "py310"
[tool.isort] [tool.isort]
profile = "black" profile = "black"
line_length = 79 line_length = 79