Skip to content

Commit a6137d7

Browse files
committed
chore: pre-commit update
1 parent 197c467 commit a6137d7

File tree

4 files changed

+16
-21
lines changed

4 files changed

+16
-21
lines changed

.pre-commit-config.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,18 @@ repos:
1111
- id: reorder-python-imports
1212
args: ["--application-directories", "src"]
1313
- repo: https://github.com/psf/black
14-
rev: 23.9.1
14+
rev: 23.12.1
1515
hooks:
1616
- id: black
1717
- repo: https://github.com/astral-sh/ruff-pre-commit
18-
rev: 'v0.0.292'
18+
rev: 'v0.1.11'
1919
hooks:
2020
- id: ruff
2121
args: [--fix, --exit-non-zero-on-fix]
22+
- repo: https://github.com/PyCQA/docformatter
23+
rev: v1.7.5
24+
hooks:
25+
- id: docformatter
2226
- repo: https://github.com/pre-commit/pre-commit-hooks
2327
rev: v4.5.0
2428
hooks:

tests/test_main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def __init__(self, **kwargs):
4646

4747

4848
class AnotherInteger(sqla_types.Integer):
49-
"""Use me to test if MRO works like we want"""
49+
"""Use me to test if MRO works like we want."""
5050

5151

5252
class TestBase(TestCase):

wtforms_sqlalchemy/fields.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
"""
2-
Useful form fields for use with SQLAlchemy ORM.
3-
"""
1+
"""Useful form fields for use with SQLAlchemy ORM."""
42
import operator
53
from collections import defaultdict
64

@@ -25,8 +23,7 @@
2523

2624

2725
class QuerySelectField(SelectFieldBase):
28-
"""
29-
Will display a select drop-down field to choose between ORM results in a
26+
"""Will display a select drop-down field to choose between ORM results in a
3027
sqlalchemy `Query`. The `data` property actually will store/keep an ORM
3128
model instance, not the ID. Submitting a choice which is not in the query
3229
will result in a validation error.
@@ -197,13 +194,12 @@ def pre_validate(self, form):
197194

198195

199196
class QuerySelectMultipleField(QuerySelectField):
200-
"""
201-
Very similar to QuerySelectField with the difference that this will
197+
"""Very similar to QuerySelectField with the difference that this will
202198
display a multiple select. The data property will hold a list with ORM
203199
model instances and will be an empty list when no value is selected.
204200
205-
If any of the items in the data list or submitted form data cannot be
206-
found in the query, this will result in a validation error.
201+
If any of the items in the data list or submitted form data cannot
202+
be found in the query, this will result in a validation error.
207203
"""
208204

209205
widget = widgets.Select(multiple=True)

wtforms_sqlalchemy/orm.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
"""
2-
Tools for generating forms based on SQLAlchemy models.
3-
"""
1+
"""Tools for generating forms based on SQLAlchemy models."""
42
import inspect
53

64
from sqlalchemy import inspect as sainspect
@@ -46,10 +44,8 @@ def __init__(self, converters, use_mro=True):
4644
self.converters = converters
4745

4846
def get_converter(self, column):
49-
"""
50-
Searches `self.converters` for a converter method with an argument that
51-
matches the column's type.
52-
"""
47+
"""Searches `self.converters` for a converter method with an argument
48+
that matches the column's type."""
5349
if self.use_mro:
5450
types = inspect.getmro(type(column.type))
5551
else:
@@ -253,8 +249,7 @@ def model_fields(
253249
exclude_pk=False,
254250
exclude_fk=False,
255251
):
256-
"""
257-
Generate a dictionary of fields for a given SQLAlchemy model.
252+
"""Generate a dictionary of fields for a given SQLAlchemy model.
258253
259254
See `model_form` docstring for description of parameters.
260255
"""

0 commit comments

Comments
 (0)