diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 76b5b4f..0b05f75 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,27 +1,23 @@ repos: - - repo: https://github.com/psf/black-pre-commit-mirror - rev: "25.1.0" - hooks: - - id: black - - repo: https://github.com/pycqa/isort - rev: "6.0.1" - hooks: - - id: isort - - repo: https://github.com/pre-commit/pre-commit-hooks - rev: "v5.0.0" - hooks: - - id: check-json - - id: end-of-file-fixer - - id: trailing-whitespace - - repo: https://github.com/abravalheri/validate-pyproject - rev: "v0.24.1" - hooks: - - id: validate-pyproject - - repo: local - hooks: - - id: stubgen - name: check API stub files - entry: scripts/stubgen.py - description: check if stub files of the APIs are up-to-date - language: script - types: [python] + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.12.1 + hooks: + - id: ruff-format + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: "v5.0.0" + hooks: + - id: check-json + - id: end-of-file-fixer + - id: trailing-whitespace + - repo: https://github.com/abravalheri/validate-pyproject + rev: "v0.24.1" + hooks: + - id: validate-pyproject + - repo: local + hooks: + - id: stubgen + name: check API stub files + entry: scripts/stubgen.py + description: check if stub files of the APIs are up-to-date + language: script + types: [python] diff --git a/pyproject.toml b/pyproject.toml index 17e14bd..d11f92b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,18 +43,6 @@ test = [ "syrupy", ] -[tool.black] -line-length = 127 -force-exclude = '.*_pb2\.py|.*\.pyi' - -[tool.isort] -combine_as_imports = true -filter_files = true -forced_separate = ["tests"] -line_length = 127 -profile = "black" -skip_glob = "*_pb2.py" - [tool.mypy] ignore_missing_imports = true diff --git a/scripts/stubgen.py b/scripts/stubgen.py index f3f6525..4036a4f 100755 --- a/scripts/stubgen.py +++ b/scripts/stubgen.py @@ -1,5 +1,6 @@ #!/usr/bin/env python3 """Generate stub files for API classes with async and sync interface.""" + from __future__ import annotations import sys