Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
Signed-off-by: Keming <kemingy94@gmail.com>
  • Loading branch information
kemingy committed Nov 24, 2024
1 parent cfa31f9 commit 8cff8ee
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 26 deletions.
8 changes: 4 additions & 4 deletions spectree/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
from .spec import SpecTree

__all__ = [
"SpecTree",
"Response",
"Tag",
"SecurityScheme",
"BaseFile",
"ExternalDocs",
"Response",
"SecurityScheme",
"SecuritySchemeData",
"SpecTree",
"Tag",
]

# setup library logging
Expand Down
14 changes: 7 additions & 7 deletions spectree/_pydantic.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@


__all__ = [
"BaseModel",
"ValidationError",
"Field",
"root_validator",
"AnyUrl",
"BaseModel",
"BaseSettings",
"EmailStr",
"validator",
"Field",
"ValidationError",
"is_base_model",
"is_base_model_instance",
"is_root_model",
"is_root_model_instance",
"root_validator",
"serialize_model_instance",
"is_base_model",
"is_base_model_instance",
"validator",
]

if PYDANTIC2:
Expand Down
2 changes: 1 addition & 1 deletion spectree/plugins/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
"starlette": Plugin(".starlette_plugin", __name__, "StarlettePlugin"),
}

__all__ = ["BasePlugin", "PLUGINS", "Plugin"]
__all__ = ["PLUGINS", "BasePlugin", "Plugin"]
4 changes: 2 additions & 2 deletions spectree/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def parse_params(
attr_to_spec_key = {"query": "query", "headers": "header", "cookies": "cookie"}
route_param_keywords = ("explode", "style", "allowReserved")

for attr in attr_to_spec_key:
for attr, position in attr_to_spec_key.items():
if hasattr(func, attr):
model = models[getattr(func, attr)]
properties = model.get("properties", {model.get("title"): model})
Expand All @@ -125,7 +125,7 @@ def parse_params(
params.append(
{
"name": name,
"in": attr_to_spec_key[attr],
"in": position,
"schema": schema,
"required": name in model.get("required", []),
"description": schema.get("description", ""),
Expand Down
18 changes: 9 additions & 9 deletions tests/flask_imports/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@
)

__all__ = [
"test_flask_return_model",
"test_flask_skip_validation",
"test_flask_validation_error_response_status_code",
"test_flask_doc",
"test_flask_optional_alias_response",
"test_flask_validate_post_data",
"test_flask_no_response",
"test_flask_upload_file",
"test_flask_list_json_request",
"test_flask_return_list_request",
"test_flask_make_response_post",
"test_flask_make_response_get",
"test_flask_make_response_post",
"test_flask_no_response",
"test_flask_optional_alias_response",
"test_flask_return_list_request",
"test_flask_return_model",
"test_flask_skip_validation",
"test_flask_upload_file",
"test_flask_validate_post_data",
"test_flask_validation_error_response_status_code",
]
6 changes: 3 additions & 3 deletions tests/quart_imports/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
)

__all__ = [
"test_quart_doc",
"test_quart_no_response",
"test_quart_return_model",
"test_quart_skip_validation",
"test_quart_validation_error_response_status_code",
"test_quart_doc",
"test_quart_validate",
"test_quart_no_response",
"test_quart_validation_error_response_status_code",
]

0 comments on commit 8cff8ee

Please sign in to comment.