Skip to content
Merged
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
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.2
hooks:
- id: mypy
args: [ --ignore-missing-imports, --check-untyped-defs, --disallow-incomplete-defs ]
Expand Down
2 changes: 1 addition & 1 deletion drf_standardized_errors/formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 4 additions & 4 deletions tests/test_openapi_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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 == {
Expand All @@ -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"}
Expand Down Expand Up @@ -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"}
Expand Down
Loading