From e4f83b92c4b82f3ccbf2f42da3021f8dd344dd26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wuyi=E6=97=A0=E7=96=91?= <444835641@qq.com> Date: Thu, 16 Feb 2023 00:11:46 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A8=20=E6=B7=BB=E5=8A=A0`ruff`?= =?UTF-8?q?=E7=9A=84`pre-commit`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .pre-commit-config.yaml | 4 ++++ gsuid_core/core.py | 1 - pyproject.toml | 5 +++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5224086..d944993 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -38,3 +38,7 @@ repos: # - id: poetry-export # args: ["-f", "requirements.txt", "--without-hashes", "-o", "requirements.txt"] # verbose: true + - repo: https://github.com/charliermarsh/ruff-pre-commit + rev: 'v0.0.245' + hooks: + - id: ruff diff --git a/gsuid_core/core.py b/gsuid_core/core.py index 803d305..bdd3e6b 100644 --- a/gsuid_core/core.py +++ b/gsuid_core/core.py @@ -35,4 +35,3 @@ async def websocket_endpoint(websocket: WebSocket, bot_id: str): if __name__ == "__main__": uvicorn.run(app, host=HOST, port=PORT) - uvicorn.run(app, host=HOST, port=PORT) diff --git a/pyproject.toml b/pyproject.toml index 4717275..a89a13a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,6 +21,7 @@ black = "^22.12.0" isort = "^5.11.4" pre-commit = "^2.21.0" pycln = "^2.1.2" +ruff = "^0.0.245" [build-system] requires = ["poetry-core"] @@ -34,6 +35,10 @@ skip-string-normalization = true extend-exclude = ''' ''' +[tool.ruff] +line-length = 79 +target-version = "py310" + [tool.isort] profile = "black" line_length = 79