From dc50c4b5f7ee97c2e64bed7a23bafc69d4e0e102 Mon Sep 17 00:00:00 2001 From: Stanislav Khlud Date: Mon, 13 Jan 2025 14:25:45 +0700 Subject: [PATCH] Update pre-commit hooks --- .pre-commit-config.yaml | 10 +++++----- .../static/import_export_extensions/js/admin/admin.js | 6 +++--- pyproject.toml | 6 ++---- test_project/conftest.py | 4 ++-- .../tests/integration_tests/test_api/test_export.py | 6 +++--- 5 files changed, 15 insertions(+), 17 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 00b0680..f339d80 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v5.0.0 hooks: - id: end-of-file-fixer - id: trailing-whitespace @@ -8,17 +8,17 @@ repos: - id: check-merge-conflict - id: detect-private-key - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.6.2 + rev: v0.9.1 hooks: - id: ruff args: [--fix] - id: ruff-format - repo: https://github.com/google/yamlfmt - rev: v0.13.0 + rev: v0.15.0 hooks: - id: yamlfmt - repo: https://github.com/asottile/add-trailing-comma - rev: v2.4.0 + rev: v3.1.0 hooks: - id: add-trailing-comma - repo: https://github.com/jorisroovers/gitlint @@ -26,7 +26,7 @@ repos: hooks: - id: gitlint - repo: https://github.com/rtts/djhtml - rev: v1.5.2 + rev: 3.0.7 hooks: - id: djhtml args: ["--tabwidth=2"] diff --git a/import_export_extensions/static/import_export_extensions/js/admin/admin.js b/import_export_extensions/static/import_export_extensions/js/admin/admin.js index 9ccc48f..74fbe1f 100644 --- a/import_export_extensions/static/import_export_extensions/js/admin/admin.js +++ b/import_export_extensions/static/import_export_extensions/js/admin/admin.js @@ -6,9 +6,9 @@ This script show/hide error detail info by clicking appropriate link: (function($) { $(document).ready(function() { const showRowData = $('.show-error-detail'), - dataStateAttr = 'state', - openedState = 'opened', - closedState = 'closed'; + dataStateAttr = 'state', + openedState = 'opened', + closedState = 'closed'; showRowData.click(function(e) { const self = $(this); diff --git a/pyproject.toml b/pyproject.toml index cce7a9e..12a1e80 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -208,12 +208,10 @@ extend-select = [ "RUF", ] ignore = [ + # https://docs.astral.sh/ruff/rules/builtin-module-shadowing + "A005", # https://docs.astral.sh/ruff/rules/missing-type-args "ANN002", - # https://docs.astral.sh/ruff/rules/missing-type-self - "ANN101", - # https://docs.astral.sh/ruff/rules/missing-type-cls - "ANN102", # https://docs.astral.sh/ruff/rules/missing-type-kwargs "ANN003", # https://docs.astral.sh/ruff/rules/any-type diff --git a/test_project/conftest.py b/test_project/conftest.py index fadba71..00c435a 100644 --- a/test_project/conftest.py +++ b/test_project/conftest.py @@ -13,12 +13,12 @@ def pytest_configure() -> None: @pytest.fixture(scope="session", autouse=True) -def django_db_setup(django_db_setup): # noqa: PT004 +def django_db_setup(django_db_setup): """Set up test db for testing.""" @pytest.fixture(autouse=True) -def enable_db_access_for_all_tests(django_db_setup, db): # noqa: PT004 +def enable_db_access_for_all_tests(django_db_setup, db): """Allow all tests to access DB.""" diff --git a/test_project/tests/integration_tests/test_api/test_export.py b/test_project/tests/integration_tests/test_api/test_export.py index 96f9cec..1cd12be 100644 --- a/test_project/tests/integration_tests/test_api/test_export.py +++ b/test_project/tests/integration_tests/test_api/test_export.py @@ -117,9 +117,9 @@ def test_export_api_ordering( assert ( export_job := ExportJob.objects.filter(id=response.data["id"]).first() ) - assert ( - export_job.resource_kwargs["ordering"] == ordering_value - ), export_job.resource_kwargs["ordering"] + assert export_job.resource_kwargs["ordering"] == ordering_value, ( + export_job.resource_kwargs["ordering"] + ) @pytest.mark.django_db(transaction=True)