From d9c59c0300b1c5b65b3e412807a20944f1f46632 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 27 Apr 2026 19:12:51 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.4.1 → v0.15.12](https://github.com/astral-sh/ruff-pre-commit/compare/v0.4.1...v0.15.12) - [github.com/pre-commit/mirrors-prettier: v3.1.0 → v4.0.0-alpha.8](https://github.com/pre-commit/mirrors-prettier/compare/v3.1.0...v4.0.0-alpha.8) - [github.com/pre-commit/pre-commit-hooks: v5.0.0 → v6.0.0](https://github.com/pre-commit/pre-commit-hooks/compare/v5.0.0...v6.0.0) - [github.com/adrienverge/yamllint: v1.35.1 → v1.38.0](https://github.com/adrienverge/yamllint/compare/v1.35.1...v1.38.0) - [github.com/igorshubovych/markdownlint-cli: v0.39.0 → v0.48.0](https://github.com/igorshubovych/markdownlint-cli/compare/v0.39.0...v0.48.0) - [github.com/PyCQA/bandit: 1.7.8 → 1.9.4](https://github.com/PyCQA/bandit/compare/1.7.8...1.9.4) --- .pre-commit-config.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 85eb3f9..6f1851b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,7 +8,7 @@ default_language_version: repos: # Ruff - Python linter and formatter (replaces Black, isort, flake8, etc.) - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.4.1 + rev: v0.15.12 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] @@ -16,14 +16,14 @@ repos: # Prettier - Code formatter for YAML, JSON, Markdown, etc. - repo: https://github.com/pre-commit/mirrors-prettier - rev: v3.1.0 + rev: v4.0.0-alpha.8 hooks: - id: prettier types_or: [yaml, markdown, json] # Standard pre-commit hooks - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v5.0.0 + rev: v6.0.0 hooks: - id: check-added-large-files args: [--maxkb=1000] @@ -43,7 +43,7 @@ repos: # yamllint - YAML linter - repo: https://github.com/adrienverge/yamllint - rev: v1.35.1 + rev: v1.38.0 hooks: - id: yamllint args: [-c, .trunk/configs/.yamllint.yaml] @@ -51,14 +51,14 @@ repos: # markdownlint - Markdown linter - repo: https://github.com/igorshubovych/markdownlint-cli - rev: v0.39.0 + rev: v0.48.0 hooks: - id: markdownlint args: [-c, .trunk/configs/.markdownlint.yaml] # Bandit - Python security linter - repo: https://github.com/PyCQA/bandit - rev: 1.7.8 + rev: 1.9.4 hooks: - id: bandit args: [-c, .trunk/configs/bandit.yaml, -r, .] From 43e35feb7c55923e80ac80662959c4f2b6da95f0 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 27 Apr 2026 19:13:04 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .pre-commit-config.yaml | 2 +- CONTRIBUTING.md | 1 + tests/functional/clients/test_enhance_client.py | 2 -- tests/unit/clients/test_session.py | 4 +++- tests/unit/models/test_response.py | 10 +++++++--- 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6f1851b..165ded4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -30,7 +30,7 @@ repos: - id: check-case-conflict - id: check-merge-conflict - id: check-yaml - args: [--unsafe] # Allow custom YAML tags + args: [--unsafe] # Allow custom YAML tags exclude: ^tests/functional/.*/cassettes/.*\.yaml$ - id: check-json - id: check-toml diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a043c9e..c47b24f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -41,6 +41,7 @@ pre-commit run --files src/diffbot_kg/models.py ``` The pre-commit configuration includes: + - **Ruff**: Python linting and formatting - **Prettier**: YAML, JSON, and Markdown formatting - **yamllint**: YAML linting diff --git a/tests/functional/clients/test_enhance_client.py b/tests/functional/clients/test_enhance_client.py index ea57f68..48beddb 100644 --- a/tests/functional/clients/test_enhance_client.py +++ b/tests/functional/clients/test_enhance_client.py @@ -174,7 +174,6 @@ async def test_bulkjob_coverage_report(self, request, token: Secret): if report_id is None: pytest.fail("Enhance bulk job coverage report ID not found in cache") - TIMEOUT = 60 BACKOFF_FACTOR = 1.5 backoff = 1 @@ -198,7 +197,6 @@ async def test_bulkjob_coverage_report(self, request, token: Secret): assert response.status == 200 assert len(response.content.strip().split("\n")) == 4 - @pytest.mark.asyncio async def test_bulkjob_stop(self, request, token: Secret): # ARRANGE diff --git a/tests/unit/clients/test_session.py b/tests/unit/clients/test_session.py index 77636d5..3354a13 100644 --- a/tests/unit/clients/test_session.py +++ b/tests/unit/clients/test_session.py @@ -26,7 +26,9 @@ def _make_error_info(status): ) -def _make_response(status=200, content_type="application/json", json_data=None, headers=None): +def _make_response( + status=200, content_type="application/json", json_data=None, headers=None +): """Create a mock aiohttp response.""" resp = MagicMock() resp.status = status diff --git a/tests/unit/models/test_response.py b/tests/unit/models/test_response.py index 14a2a3a..1434f9a 100644 --- a/tests/unit/models/test_response.py +++ b/tests/unit/models/test_response.py @@ -1,4 +1,4 @@ -from unittest.mock import AsyncMock, PropertyMock +from unittest.mock import AsyncMock import pytest from multidict import CIMultiDict, CIMultiDictProxy @@ -19,7 +19,9 @@ def _mock_headers(extra=None): return CIMultiDictProxy(CIMultiDict(extra or {})) -def _mock_aiohttp_response(content_type, json_data=None, text_data="", status=200, headers=None): +def _mock_aiohttp_response( + content_type, json_data=None, text_data="", status=200, headers=None +): resp = AsyncMock() resp.status = status resp.content_type = content_type @@ -127,7 +129,9 @@ def test_job_id(self): assert resp.jobId == "job-456" def test_complete_true(self): - content = {"content": {"job_id": "job-456", "status": "COMPLETE", "reports": []}} + content = { + "content": {"job_id": "job-456", "status": "COMPLETE", "reports": []} + } resp = DiffbotBulkJobStatusResponse(200, _mock_headers(), content) assert resp.complete is True