Skip to content

Commit

Permalink
Merge pull request #816 from marshmallow-code/pre-commit-ci-update-co…
Browse files Browse the repository at this point in the history
…nfig

[pre-commit.ci] pre-commit autoupdate
  • Loading branch information
lafrech committed Dec 19, 2022
2 parents 5f356b3 + 65bcd43 commit ec6a7f7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
repos:
- repo: https://github.com/asottile/pyupgrade
rev: v2.38.0
rev: v3.3.1
hooks:
- id: pyupgrade
args: [--py37-plus]
- repo: https://github.com/python/black
rev: 22.8.0
- repo: https://github.com/psf/black
rev: 22.12.0
hooks:
- id: black
language_version: python3
- repo: https://github.com/pycqa/flake8
rev: 5.0.4
rev: 6.0.0
hooks:
- id: flake8
additional_dependencies: [flake8-bugbear==22.9.11]
additional_dependencies: [flake8-bugbear==22.12.6]
- repo: https://github.com/asottile/blacken-docs
rev: v1.12.1
hooks:
- id: blacken-docs
additional_dependencies: [black==22.3.0]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.971
rev: v0.991
hooks:
- id: mypy
additional_dependencies: ["marshmallow>=3,<4", "types-PyYAML"]
8 changes: 3 additions & 5 deletions src/apispec/ext/marshmallow/field_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,15 +239,15 @@ def field2choices(
attributes = {}

comparable = [
validator.comparable # type:ignore
validator.comparable
for validator in field.validators
if hasattr(validator, "comparable")
]
if comparable:
attributes["enum"] = comparable
else:
choices = [
OrderedSet(validator.choices) # type:ignore
OrderedSet(validator.choices)
for validator in field.validators
if hasattr(validator, "choices")
]
Expand Down Expand Up @@ -348,9 +348,7 @@ def field2length(
max_attr = "maxItems" if is_array else "maxLength"

equal_list = [
validator.equal # type:ignore
for validator in validators
if validator.equal is not None # type:ignore
validator.equal for validator in validators if validator.equal is not None
]
if equal_list:
return {min_attr: equal_list[0], max_attr: equal_list[0]}
Expand Down
2 changes: 1 addition & 1 deletion tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1185,7 +1185,7 @@ def test_plugin_operation_helper_is_used(self, openapi_version):
class TestPluginsOrder:
class OrderedPlugin(BasePlugin):
def __init__(self, index, output):
super(TestPluginsOrder.OrderedPlugin, self).__init__()
super().__init__()
self.index = index
self.output = output

Expand Down

0 comments on commit ec6a7f7

Please sign in to comment.