Skip to content

Commit

Permalink
pre-commit upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
azmeuk committed Dec 23, 2021
1 parent ab50409 commit ce4e26f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
---
repos:
- repo: https://github.com/asottile/pyupgrade
rev: v2.7.2
rev: v2.29.1
hooks:
- id: pyupgrade
args: ["--py36-plus"]
- repo: https://github.com/asottile/reorder_python_imports
rev: v2.3.5
rev: v2.6.0
hooks:
- id: reorder-python-imports
args: ["--application-directories", "src"]
- repo: https://github.com/psf/black
rev: 20.8b1
rev: 21.12b0
hooks:
- id: black
- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.4
rev: 3.9.2
hooks:
- id: flake8
additional_dependencies:
- flake8-bugbear
- flake8-implicit-str-concat
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
rev: v4.0.1
hooks:
- id: check-byte-order-marker
- id: trailing-whitespace
Expand Down
8 changes: 3 additions & 5 deletions src/wtforms/widgets/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def html_params(**kwargs):
elif v is False:
pass
else:
params.append('{}="{}"'.format(str(k), escape(v)))
params.append(f'{str(k)}="{escape(v)}"')
return " ".join(params)


Expand All @@ -103,7 +103,7 @@ def __init__(self, html_tag="ul", prefix_label=True):

def __call__(self, field, **kwargs):
kwargs.setdefault("id", field.id)
html = ["<{} {}>".format(self.html_tag, html_params(**kwargs))]
html = [f"<{self.html_tag} {html_params(**kwargs)}>"]
for subfield in field:
if self.prefix_label:
html.append(f"<li>{subfield.label} {subfield()}</li>")
Expand Down Expand Up @@ -362,9 +362,7 @@ def render_option(cls, value, label, selected, **kwargs):
options = dict(kwargs, value=value)
if selected:
options["selected"] = True
return Markup(
"<option {}>{}</option>".format(html_params(**options), escape(label))
)
return Markup(f"<option {html_params(**options)}>{escape(label)}</option>")


class Option:
Expand Down

0 comments on commit ce4e26f

Please sign in to comment.