Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,29 @@ 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.10
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format

# 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]
- 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
Expand All @@ -43,22 +43,22 @@ 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]
exclude: ^tests/functional/.*/cassettes/.*\.yaml$

# 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, .]
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions tests/functional/clients/test_enhance_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 3 additions & 1 deletion tests/unit/clients/test_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 7 additions & 3 deletions tests/unit/models/test_response.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from unittest.mock import AsyncMock, PropertyMock
from unittest.mock import AsyncMock

import pytest
from multidict import CIMultiDict, CIMultiDictProxy
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
Loading