Skip to content

Commit

Permalink
Merge pull request #1185 from benjaoming/upgrade-black
Browse files Browse the repository at this point in the history
Upgrade pre-commit and black
  • Loading branch information
benjaoming committed Apr 13, 2022
2 parents d0e73fe + c7e6ead commit 1af12aa
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
repos:
- repo: https://gitlab.com/pycqa/flake8
rev: '' # pick a git hash / tag to point to
rev: '3.9.2' # pick a git hash / tag to point to
hooks:
- id: flake8
exclude: "^(.*/migrations/|testproject/testproject/settings/)"
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
rev: v4.2.0
hooks:
- id: trailing-whitespace
exclude: "^.tx/"
Expand All @@ -14,12 +14,12 @@ repos:
- id: end-of-file-fixer
exclude: "^(.tx/.*|.*\\.map)$"
- repo: https://github.com/psf/black
rev: 20.8b1
rev: 22.3.0
hooks:
- id: black
language_version: python3

- repo: https://github.com/asottile/reorder_python_imports
rev: v2.4.0
rev: v3.0.1
hooks:
- id: reorder-python-imports
8 changes: 4 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,21 +68,21 @@ def process_docstring(app, what, name, obj, options, lines):
if help_text:
# Add the model field to the end of the docstring as a param
# using the help text as the description
lines.append(u":param %s: %s" % (field.attname, help_text))
lines.append(":param %s: %s" % (field.attname, help_text))
else:
# Add the model field to the end of the docstring as a param
# using the verbose name as the description
lines.append(u":param %s: %s" % (field.attname, verbose_name))
lines.append(":param %s: %s" % (field.attname, verbose_name))

# Add the field's type to the docstring
if isinstance(field, models.ForeignKey):
for to in field.to_fields:
lines.append(
u":type %s: %s to :class:`~%s`"
":type %s: %s to :class:`~%s`"
% (field.attname, type(field).__name__, to)
)
else:
lines.append(u":type %s: %s" % (field.attname, type(field).__name__))
lines.append(":type %s: %s" % (field.attname, type(field).__name__))

return lines

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def get_path(fname):
"flake8>=3.7,<4.1",
# Somewhat pin black, such that older code bases can
# be verified CI without linting them lots
"black>=20.8b1,<20.9",
"black>=22.3.0,<22.4",
"pre-commit",
]

Expand Down
2 changes: 1 addition & 1 deletion src/wiki/plugins/links/mdx/djangowikilinks.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def handleMatch(self, m): # noqa: max-complexity 11
return a

def _getMeta(self):
""" Return meta data or config data. """
"""Return meta data or config data."""
base_url = self.config["base_url"][0]
html_class = self.config["html_class"][0]
if hasattr(self.md, "Meta"):
Expand Down
4 changes: 2 additions & 2 deletions src/wiki/plugins/links/mdx/urlize.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,13 @@ def handleMatch(self, m):


class UrlizeExtension(markdown.extensions.Extension):
""" Urlize Extension for Python-Markdown. """
"""Urlize Extension for Python-Markdown."""

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)

def extendMarkdown(self, md):
""" Replace autolink with UrlizePattern """
"""Replace autolink with UrlizePattern"""
md.inlinePatterns["autolink"] = UrlizePattern(URLIZE_RE, md)


Expand Down

0 comments on commit 1af12aa

Please sign in to comment.