From e0de87d4924994eca8084ac46de18478ac97e449 Mon Sep 17 00:00:00 2001 From: Andrew Miller Date: Fri, 12 Jun 2026 15:37:35 -0500 Subject: [PATCH 1/2] Add pre-commit hooks for ruff, mypy, and pytest Runs ruff check, ruff format --check, mypy src, and pytest before every commit. Install with: pre-commit install Co-Authored-By: Claude Sonnet 4.6 --- .pre-commit-config.yaml | 26 ++++++++++++++++++++++++++ pyproject.toml | 1 + 2 files changed, 27 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..a4e354e --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,26 @@ +repos: + - repo: local + hooks: + - id: ruff-check + name: ruff check + entry: ruff check . + language: system + pass_filenames: false + + - id: ruff-format-check + name: ruff format --check + entry: ruff format --check . + language: system + pass_filenames: false + + - id: mypy + name: mypy + entry: mypy src + language: system + pass_filenames: false + + - id: pytest + name: pytest + entry: pytest + language: system + pass_filenames: false diff --git a/pyproject.toml b/pyproject.toml index 9cc7d60..e25220f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,6 +21,7 @@ dev = [ "respx>=0.21", "ruff>=0.4", "mypy>=1.10", + "pre-commit>=3.0", ] [project.urls] From 530d741784bea91b8aa7f5d2a9ebf190f48864df Mon Sep 17 00:00:00 2001 From: Andrew Miller Date: Fri, 12 Jun 2026 15:40:56 -0500 Subject: [PATCH 2/2] Add GitHub Actions CI pipeline Runs ruff check, ruff format --check, mypy, and pytest on every push and pull request. Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/ci.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..7104fec --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,30 @@ +name: CI + +on: + push: + pull_request: + +jobs: + quality: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: "3.10" + + - name: Install dependencies + run: pip install -e ".[dev]" + + - name: ruff check + run: ruff check . + + - name: ruff format --check + run: ruff format --check . + + - name: mypy + run: mypy src + + - name: pytest + run: pytest