Skip to content

Commit 84d64b5

Browse files
committed
Bump pre-commit Ruff to 0.12.5
1 parent c7831c6 commit 84d64b5

File tree

10 files changed

+14
-18
lines changed

10 files changed

+14
-18
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ repos:
2020

2121
- repo: https://github.com/astral-sh/ruff-pre-commit
2222
# Ruff version.
23-
rev: v0.1.3
23+
rev: v0.12.5
2424
hooks:
2525
- id: ruff
2626
args: ["--fix", "--show-fixes"]

django_mongodb_backend/compiler.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -728,13 +728,11 @@ def execute_sql(self, result_type):
728728
value = value.resolve_expression(self.query, allow_joins=False, for_save=True)
729729
if value.contains_aggregate:
730730
raise FieldError(
731-
"Aggregate functions are not allowed in this query "
732-
f"({field.name}={value})."
731+
f"Aggregate functions are not allowed in this query ({field.name}={value})."
733732
)
734733
if value.contains_over_clause:
735734
raise FieldError(
736-
"Window expressions are not allowed in this query "
737-
f"({field.name}={value})."
735+
f"Window expressions are not allowed in this query ({field.name}={value})."
738736
)
739737
elif hasattr(value, "prepare_database_save"):
740738
if field.remote_field:

django_mongodb_backend/indexes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ def check(self, model, connection):
237237
if num_arrayfields == 0:
238238
errors.append(
239239
Error(
240-
"VectorSearchIndex requires at least one ArrayField to " "store vector data.",
240+
"VectorSearchIndex requires at least one ArrayField to store vector data.",
241241
obj=model,
242242
id=f"{self._error_id_prefix}.E006",
243243
hint="If you want to perform search operations without vectors, "

tests/cache_/tests.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""These tests are forked from Django's tests/cache/tests.py."""
2+
23
import os
34
import pickle
45
import time
@@ -550,7 +551,7 @@ def test_invalid_key_length(self):
550551
# memcached limits key length to 250.
551552
key = ("a" * 250) + "清"
552553
expected_warning = (
553-
"Cache key will cause errors if used with memcached: " f"'{key}' (longer than 250)"
554+
f"Cache key will cause errors if used with memcached: '{key}' (longer than 250)"
554555
)
555556
self._perform_invalid_key_test(key, expected_warning)
556557

tests/forms_tests_/test_array.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,7 @@ class SplitForm(forms.Form):
240240

241241
def test_invalid_integer(self):
242242
msg = (
243-
"Item 2 in the array did not validate: Ensure this value is less than or "
244-
"equal to 100."
243+
"Item 2 in the array did not validate: Ensure this value is less than or equal to 100."
245244
)
246245
with self.assertRaisesMessage(exceptions.ValidationError, msg):
247246
SplitArrayField(forms.IntegerField(max_value=100), size=2).clean([0, 101])

tests/indexes_/test_checks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ class Meta:
212212
errors,
213213
[
214214
checks.Error(
215-
"VectorSearchIndex requires at least one ArrayField to " "store vector data.",
215+
"VectorSearchIndex requires at least one ArrayField to store vector data.",
216216
id="django_mongodb_backend.indexes.VectorSearchIndex.E006",
217217
obj=NoSearchVectorModel,
218218
hint="If you want to perform search operations without vectors, "

tests/model_fields_/test_arrayfield.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -542,11 +542,11 @@ class TestEnum(enum.Enum):
542542
)
543543

544544
def test_unsupported_lookup(self):
545-
msg = "Unsupported lookup '0_bar' for ArrayField or join on the field not " "permitted."
545+
msg = "Unsupported lookup '0_bar' for ArrayField or join on the field not permitted."
546546
with self.assertRaisesMessage(FieldError, msg):
547547
list(NullableIntegerArrayModel.objects.filter(field__0_bar=[2]))
548548

549-
msg = "Unsupported lookup '0bar' for ArrayField or join on the field not " "permitted."
549+
msg = "Unsupported lookup '0bar' for ArrayField or join on the field not permitted."
550550
with self.assertRaisesMessage(FieldError, msg):
551551
list(NullableIntegerArrayModel.objects.filter(field__0bar=[2]))
552552

tests/model_fields_/test_embedded_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def test_deconstruct(self):
3838
self.assertEqual(kwargs, {"embedded_model": "Data", "null": True})
3939

4040
def test_get_db_prep_save_invalid(self):
41-
msg = "Expected instance of type <class 'model_fields_.models.Data'>, " "not <class 'int'>."
41+
msg = "Expected instance of type <class 'model_fields_.models.Data'>, not <class 'int'>."
4242
with self.assertRaisesMessage(TypeError, msg):
4343
Holder(data=42).save()
4444

tests/model_fields_/test_polymorphic_embedded_model_array.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,14 +156,12 @@ def test_invalid_field(self):
156156
Owner.objects.filter(pets__xxx=10).first()
157157

158158
def test_invalid_lookup(self):
159-
msg = "Unsupported lookup 'return' for PolymorphicEmbeddedModelArrayField " "of 'CharField'"
159+
msg = "Unsupported lookup 'return' for PolymorphicEmbeddedModelArrayField of 'CharField'"
160160
with self.assertRaisesMessage(FieldDoesNotExist, msg):
161161
Owner.objects.filter(pets__name__return="xxx")
162162

163163
def test_unsupported_lookup(self):
164-
msg = (
165-
"Unsupported lookup 'range' for PolymorphicEmbeddedModelArrayField " "of 'DecimalField'"
166-
)
164+
msg = "Unsupported lookup 'range' for PolymorphicEmbeddedModelArrayField of 'DecimalField'"
167165
with self.assertRaisesMessage(FieldDoesNotExist, msg):
168166
Owner.objects.filter(pets__weight__range=[10])
169167

tests/raw_query_/test_raw_aggregate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def setUpTestData(cls):
3333
author=cls.a1,
3434
paperback=False,
3535
opening_line=(
36-
"It was a bright cold day in April and the clocks were striking " "thirteen."
36+
"It was a bright cold day in April and the clocks were striking thirteen."
3737
),
3838
)
3939
cls.b2 = Book.objects.create(

0 commit comments

Comments
 (0)