From 7e0b9553c808e415e1b0710e5c59ceddcab25171 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E8=88=AA=E5=AE=87?= <3364451258@qq.com> Date: Sat, 11 Jul 2026 20:08:21 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E9=85=8D=E7=BD=AE=20pre-commit=20?= =?UTF-8?q?=E9=92=A9=E5=AD=90=EF=BC=88ruff=20+=20mypy=20+=20=E9=80=9A?= =?UTF-8?q?=E7=94=A8=E6=A3=80=E6=9F=A5=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .pre-commit-config.yaml | 31 +++++++++++++++++++++++++++++++ pyproject.toml | 5 +++++ 2 files changed, 36 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..96dae98 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,31 @@ +repos: + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.11.0 + hooks: + - id: ruff + args: [--fix] + - id: ruff-format + + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v5.0.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + args: [--unsafe] + - id: check-json + - id: check-toml + - id: check-added-large-files + args: ['--maxkb=500'] + - id: detect-private-key + - id: debug-statements + + - repo: https://github.com/pre-commit/mirrors-mypy + rev: v1.15.0 + hooks: + - id: mypy + args: [--ignore-missing-imports, --no-strict-optional] + files: ^src/ + additional_dependencies: + - types-pyyaml + - types-requests diff --git a/pyproject.toml b/pyproject.toml index 0b132de..d814990 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -41,6 +41,11 @@ index-strategy = "unsafe-best-match" line-length = 100 target-version = "py313" +[tool.ruff.format] +quote-style = "double" +indent-style = "space" +skip-magic-trailing-comma = false + [tool.ruff.lint] select = ["E", "F", "I", "N", "W"]