Skip to content

Commit 1551af1

Browse files
committed
Run pre-commit run black -a
1 parent f790769 commit 1551af1

File tree

9 files changed

+22
-13
lines changed

9 files changed

+22
-13
lines changed

openapi_spec_validator/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""OpenAPI spec validator module."""
2+
23
from openapi_spec_validator.shortcuts import validate
34
from openapi_spec_validator.shortcuts import validate_spec
45
from openapi_spec_validator.shortcuts import validate_spec_url

openapi_spec_validator/schemas/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""OpenAIP spec validator schemas module."""
2+
23
from functools import partial
34

45
from jsonschema.validators import Draft4Validator

openapi_spec_validator/schemas/utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""OpenAIP spec validator schemas utils module."""
2+
23
from importlib.resources import as_file
34
from importlib.resources import files
45
from os import path

openapi_spec_validator/shortcuts.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""OpenAPI spec validator shortcuts module."""
2+
23
import warnings
34
from collections.abc import Mapping
45
from typing import Optional

openapi_spec_validator/validation/decorators.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""OpenAPI spec validator validation decorators module."""
2+
23
import logging
34
from functools import wraps
45
from typing import Any
@@ -19,7 +20,7 @@
1920

2021

2122
def wraps_errors(
22-
func: Callable[..., Any]
23+
func: Callable[..., Any],
2324
) -> Callable[..., Iterator[ValidationError]]:
2425
@wraps(func)
2526
def wrapper(*args: Any, **kwds: Any) -> Iterator[ValidationError]:
@@ -35,7 +36,7 @@ def wrapper(*args: Any, **kwds: Any) -> Iterator[ValidationError]:
3536

3637

3738
def wraps_cached_iter(
38-
func: Callable[[Args], Iterator[T]]
39+
func: Callable[[Args], Iterator[T]],
3940
) -> Callable[[Args], CachedIterable[T]]:
4041
@wraps(func)
4142
def wrapper(*args: Any, **kwargs: Any) -> CachedIterable[T]:
@@ -46,7 +47,7 @@ def wrapper(*args: Any, **kwargs: Any) -> CachedIterable[T]:
4647

4748

4849
def unwraps_iter(
49-
func: Callable[[Args], Iterable[T]]
50+
func: Callable[[Args], Iterable[T]],
5051
) -> Callable[[Args], Iterator[T]]:
5152
@wraps(func)
5253
def wrapper(*args: Any, **kwargs: Any) -> Iterator[T]:

openapi_spec_validator/validation/keywords.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,9 @@ def __call__(
113113
all_of = schema / "allOf"
114114
for inner_schema in all_of:
115115
yield from self(inner_schema, require_properties=False)
116-
nested_properties += list(self._collect_properties(inner_schema))
117-
116+
nested_properties += list(
117+
self._collect_properties(inner_schema)
118+
)
118119

119120
if "anyOf" in schema:
120121
any_of = schema / "anyOf"
@@ -154,8 +155,12 @@ def __call__(
154155
require_properties=False,
155156
)
156157

157-
required = "required" in schema and (schema / "required").read_value() or []
158-
properties = "properties" in schema and (schema / "properties").keys() or []
158+
required = (
159+
"required" in schema and (schema / "required").read_value() or []
160+
)
161+
properties = (
162+
"properties" in schema and (schema / "properties").keys() or []
163+
)
159164
if "allOf" in schema:
160165
extra_properties = list(
161166
set(required) - set(properties) - set(nested_properties)

openapi_spec_validator/validation/protocols.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,18 @@
1010

1111
@runtime_checkable
1212
class SupportsValidation(Protocol):
13-
def is_valid(self, instance: Schema) -> bool:
14-
...
13+
def is_valid(self, instance: Schema) -> bool: ...
1514

1615
def iter_errors(
1716
self,
1817
instance: Schema,
1918
base_uri: str = "",
2019
spec_url: Optional[str] = None,
21-
) -> Iterator[OpenAPIValidationError]:
22-
...
20+
) -> Iterator[OpenAPIValidationError]: ...
2321

2422
def validate(
2523
self,
2624
instance: Schema,
2725
base_uri: str = "",
2826
spec_url: Optional[str] = None,
29-
) -> None:
30-
...
27+
) -> None: ...

openapi_spec_validator/validation/proxies.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""OpenAPI spec validator validation proxies module."""
2+
23
import warnings
34
from collections.abc import Hashable
45
from typing import Any

openapi_spec_validator/validation/validators.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""OpenAPI spec validator validation validators module."""
2+
23
import logging
34
import warnings
45
from functools import lru_cache

0 commit comments

Comments
 (0)