From e7fb854b23a3e425181d3bbf7f0c521c04feae15 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 13 Apr 2026 16:54:28 +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/pre-commit/mirrors-mypy: v1.19.0 → v1.20.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.19.0...v1.20.1) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3656554..69ef574 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,7 +22,7 @@ repos: args: [ --max-line-length, '120' , --ignore, 'E,W'] - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.19.0 + rev: v1.20.1 hooks: - id: mypy args: [ --ignore-missing-imports, --check-untyped-defs, --disallow-incomplete-defs ] From 344d570e69e483cb56ccac699fce834d139ce457 Mon Sep 17 00:00:00 2001 From: ghazi Date: Mon, 27 Apr 2026 10:05:09 +0100 Subject: [PATCH 2/2] update linting tools versions and run them on the repo --- .pre-commit-config.yaml | 4 ++-- drf_standardized_errors/formatter.py | 2 +- tests/test_openapi_utils.py | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 69ef574..13ec65e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,7 +12,7 @@ repos: rev: 2025.6.1 hooks: - id: shed - additional_dependencies: [ 'black~=25.1' ] + additional_dependencies: [ 'black~=26.3.1' ] types_or: [ python, pyi, markdown, rst ] - repo: https://github.com/PyCQA/flake8 @@ -22,7 +22,7 @@ repos: args: [ --max-line-length, '120' , --ignore, 'E,W'] - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.20.1 + rev: v1.20.2 hooks: - id: mypy args: [ --ignore-missing-imports, --check-untyped-defs, --disallow-incomplete-defs ] diff --git a/drf_standardized_errors/formatter.py b/drf_standardized_errors/formatter.py index 62d2684..f51c374 100644 --- a/drf_standardized_errors/formatter.py +++ b/drf_standardized_errors/formatter.py @@ -140,6 +140,6 @@ def flatten_errors( fifo.append((value, key, None)) else: - errors.append(Error(detail.code, str(detail), attr)) + errors.append(Error(detail.code, str(detail), attr)) # type: ignore[union-attr] return errors diff --git a/tests/test_openapi_utils.py b/tests/test_openapi_utils.py index 5630765..d3f8c6d 100644 --- a/tests/test_openapi_utils.py +++ b/tests/test_openapi_utils.py @@ -505,7 +505,7 @@ class CharForm(forms.Form): def test_char_fields_with_error_codes(): - (char, slug, regex, uuid, ip) = get_form_fields_with_error_codes(CharForm()) + char, slug, regex, uuid, ip = get_form_fields_with_error_codes(CharForm()) assert char.error_codes == { "required", @@ -535,7 +535,7 @@ class NumberForm(forms.Form): def test_number_fields_with_error_codes(): - (integer, dec1, dec2, dec3, dec4) = get_form_fields_with_error_codes(NumberForm()) + integer, dec1, dec2, dec3, dec4 = get_form_fields_with_error_codes(NumberForm()) assert integer.error_codes == {"required", "max_value", "min_value", "invalid"} assert dec1.error_codes == { @@ -556,7 +556,7 @@ class TemporalForm(forms.Form): def test_temporal_fields_with_error_codes(): - (date, datetime, duration) = get_form_fields_with_error_codes(TemporalForm()) + date, datetime, duration = get_form_fields_with_error_codes(TemporalForm()) assert date.error_codes == {"required", "invalid"} assert datetime.error_codes == {"invalid"} @@ -587,7 +587,7 @@ class ChoiceForm(forms.Form): def test_choice_fields_with_error_codes(): - (choice, multiple_choice) = get_form_fields_with_error_codes(ChoiceForm()) + choice, multiple_choice = get_form_fields_with_error_codes(ChoiceForm()) assert choice.error_codes == {"required", "invalid_choice"} assert multiple_choice.error_codes == {"invalid_choice", "invalid_list"}