Skip to content

Commit 4bd0ca9

Browse files
[pre-commit.ci] pre-commit autoupdate (#989)
<!--pre-commit.ci start--> updates: - [github.com/psf/black: 22.12.0 → 23.1.0](psf/black@22.12.0...23.1.0) <!--pre-commit.ci end--> --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 37709bb commit 4bd0ca9

32 files changed

+4
-48
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ repos:
2525
- id: pyupgrade
2626
args: [--py37-plus]
2727
- repo: https://github.com/psf/black
28-
rev: 22.12.0
28+
rev: 23.1.0
2929
hooks:
3030
- id: black
3131
- repo: https://github.com/adamchainz/blacken-docs

src/django_mysql/cache.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ def get_reverse_key_func(
112112

113113

114114
class MySQLCache(BaseDatabaseCache):
115-
116115
# Got an error with the add() query using BIGINT_UNSIGNED_MAX, so use a
117116
# value slightly 1 bit less (still an incalculable time into the future of
118117
# 1970)
@@ -258,7 +257,6 @@ def _base_set(
258257

259258
self._maybe_cull()
260259
with connections[db].cursor() as cursor:
261-
262260
value, value_type = self.encode(value)
263261

264262
params: tuple[Any, ...]

src/django_mysql/forms.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616

1717
class SimpleListField(forms.CharField):
18-
1918
default_error_messages = {
2019
"item_n_invalid": _("Item %(nth)s in the list did not validate: "),
2120
"no_double_commas": _("No leading, trailing, or double commas."),

src/django_mysql/models/aggregates.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ def __init__(
3535
ordering: str | None = None,
3636
**extra: Any,
3737
) -> None:
38-
3938
if "output_field" not in extra:
4039
# This can/will be improved to SetTextField or ListTextField
4140
extra["output_field"] = CharField()

src/django_mysql/models/expressions.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ def popleft(self) -> PopLeftListF:
4848

4949

5050
class AppendListF(TwoSidedExpression):
51-
5251
# A slightly complicated expression.
5352
# basically if 'value' is not in the set, concat the current set with a
5453
# comma and 'value'
@@ -83,7 +82,6 @@ def as_sql(
8382

8483

8584
class AppendLeftListF(TwoSidedExpression):
86-
8785
# A slightly complicated expression.
8886
# basically if 'value' is not in the set, concat the current set with a
8987
# comma and 'value'
@@ -118,7 +116,6 @@ def as_sql(
118116

119117

120118
class PopListF(BaseExpression):
121-
122119
sql_expression = collapse_spaces(
123120
"""
124121
SUBSTRING(
@@ -159,7 +156,6 @@ def as_sql(
159156

160157

161158
class PopLeftListF(BaseExpression):
162-
163159
sql_expression = collapse_spaces(
164160
"""
165161
IF(
@@ -207,7 +203,6 @@ def remove(self, value: Any | BaseExpression) -> RemoveSetF:
207203

208204

209205
class AddSetF(TwoSidedExpression):
210-
211206
# A slightly complicated expression.
212207
# basically if 'value' is not in the set, concat the current set with a
213208
# comma and 'value'
@@ -242,7 +237,6 @@ def as_sql(
242237

243238

244239
class RemoveSetF(TwoSidedExpression):
245-
246240
# Wow, this is a real doozy of an expression.
247241
# Basically, if it IS in the set, cut the string up to be everything except
248242
# that element.

src/django_mysql/models/fields/dynamic.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,6 @@ def validate_spec(
256256
) -> None:
257257
for key, subspec in spec.items():
258258
if key in value:
259-
260259
expected_type = dict if isinstance(subspec, dict) else subspec
261260
if not isinstance(value[key], expected_type):
262261
raise TypeError(
@@ -304,7 +303,6 @@ def formfield(self, *args: Any, **kwargs: Any) -> FormField | None:
304303

305304

306305
class KeyTransform(Transform):
307-
308306
SPEC_MAP = {
309307
dt.date: "DATE",
310308
dt.datetime: "DATETIME",

src/django_mysql/models/functions.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525

2626

2727
class SingleArgFunc(Func):
28-
2928
output_field_class: type[DjangoField]
3029

3130
def __init__(self, expression: ExpressionArgument) -> None:

src/django_mysql/rewrite_query.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,7 @@ def modify_sql(
143143

144144
# Don't bother with SELECT rewrite rules on non-SELECT queries
145145
if tokens[0] == "SELECT":
146-
147146
for group_name, hint_set in SELECT_HINTS.items():
148-
149147
try:
150148
# Take the last hint we were told to add from this hint_set
151149
to_add = [hint for hint in add_hints if hint in hint_set][-1]

src/django_mysql/test/utils.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ def wrap_class(self, klass: type[Any]) -> None:
7575

7676
def enable(self) -> None:
7777
with connections[self.db].cursor() as cursor:
78-
7978
for key, value in self.options.items():
8079
cursor.execute(
8180
"""SET @overridden_{prefix}_{name} = @@{name},
@@ -88,7 +87,6 @@ def enable(self) -> None:
8887

8988
def disable(self) -> None:
9089
with connections[self.db].cursor() as cursor:
91-
9290
for key in self.options:
9391
cursor.execute(
9492
"""SET @@{name} = @overridden_{prefix}_{name},

tests/testapp/enum_default_migrations/0001_initial.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88

99
class Migration(migrations.Migration):
10-
1110
dependencies: list[tuple[str, str]] = []
1211

1312
operations = [

0 commit comments

Comments
 (0)