Skip to content

Commit

Permalink
try fix ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
anikaweinmann committed Dec 12, 2024
1 parent 61b786d commit 5f61b84
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 15 deletions.
4 changes: 2 additions & 2 deletions src/actinia_example_plugin/api/helloworld.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ def __init__(self) -> None:
"""Hello world class initialisation."""
self.msg = "Hello world!"

@swagger.doc(helloworld.describeHelloWorld_get_docs)
@swagger.doc(helloworld.describe_hello_world_get_docs)
def get(self) -> SimpleStatusCodeResponseModel:
"""Get 'Hello world!' as answer string."""
return SimpleStatusCodeResponseModel(status=200, message=self.msg)

@swagger.doc(helloworld.describeHelloWorld_post_docs)
@swagger.doc(helloworld.describe_hello_world_post_docs)
def post(self) -> SimpleStatusCodeResponseModel:
"""Hello World post method with name from postbody."""
req_data = request.get_json(force=True)
Expand Down
4 changes: 2 additions & 2 deletions src/actinia_example_plugin/api/project_helloworld.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ def __init__(self) -> None:
"""Project hello world class initialisation."""
self.msg = "Project: Hello world!"

@swagger.doc(project_helloworld.describeProjectHelloWorld_get_docs)
@swagger.doc(project_helloworld.describe_project_hello_world_get_docs)
def get(self, project_name) -> SimpleStatusCodeResponseModel:

Check failure on line 44 in src/actinia_example_plugin/api/project_helloworld.py

View workflow job for this annotation

GitHub Actions / lint / ruff

Ruff (ANN001)

src/actinia_example_plugin/api/project_helloworld.py:44:19: ANN001 Missing type annotation for function argument `project_name`

Check failure on line 44 in src/actinia_example_plugin/api/project_helloworld.py

View workflow job for this annotation

GitHub Actions / lint / ruff

Ruff (ANN001)

src/actinia_example_plugin/api/project_helloworld.py:44:19: ANN001 Missing type annotation for function argument `project_name`
"""Get 'Hello world!' as answer string."""
msg = f"{self.msg} {project_name}"
return SimpleStatusCodeResponseModel(status=200, message=msg)

@swagger.doc(project_helloworld.describeProjectHelloWorld_post_docs)
@swagger.doc(project_helloworld.describe_project_hello_world_post_docs)
def post(self, project_name) -> SimpleStatusCodeResponseModel:

Check failure on line 50 in src/actinia_example_plugin/api/project_helloworld.py

View workflow job for this annotation

GitHub Actions / lint / ruff

Ruff (ANN001)

src/actinia_example_plugin/api/project_helloworld.py:50:20: ANN001 Missing type annotation for function argument `project_name`

Check failure on line 50 in src/actinia_example_plugin/api/project_helloworld.py

View workflow job for this annotation

GitHub Actions / lint / ruff

Ruff (ANN001)

src/actinia_example_plugin/api/project_helloworld.py:50:20: ANN001 Missing type annotation for function argument `project_name`
"""Hello World post method with name from postbody."""
req_data = request.get_json(force=True)
Expand Down
10 changes: 4 additions & 6 deletions src/actinia_example_plugin/apidocs/helloworld.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,10 @@
__maintainer__ = "mundialis GmbH & Co. KG"


from actinia_example_plugin.model.response_models import (
SimpleStatusCodeResponseModel,
)
from actinia_example_plugin.model.response_models import \
SimpleStatusCodeResponseModel


describeHelloWorld_get_docs = {
describe_hello_world_get_docs = {

Check failure on line 29 in src/actinia_example_plugin/apidocs/helloworld.py

View workflow job for this annotation

GitHub Actions / lint / ruff

Ruff (I001)

src/actinia_example_plugin/apidocs/helloworld.py:26:1: I001 Import block is un-sorted or un-formatted

Check failure on line 29 in src/actinia_example_plugin/apidocs/helloworld.py

View workflow job for this annotation

GitHub Actions / lint / ruff

Ruff (I001)

src/actinia_example_plugin/apidocs/helloworld.py:26:1: I001 Import block is un-sorted or un-formatted
# "summary" is taken from the description of the get method
"tags": ["example"],
"description": "Hello World example",
Expand All @@ -40,7 +38,7 @@
},
}

describeHelloWorld_post_docs = {
describe_hello_world_post_docs = {
# "summary" is taken from the description of the get method
"tags": ["example"],
"description": "Hello World example with name",
Expand Down
9 changes: 4 additions & 5 deletions src/actinia_example_plugin/apidocs/project_helloworld.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@
__maintainer__ = "mundialis GmbH & Co. KG"


from actinia_example_plugin.model.response_models import (
SimpleStatusCodeResponseModel,
)
from actinia_example_plugin.model.response_models import \
SimpleStatusCodeResponseModel

describeProjectHelloWorld_get_docs = {
describe_project_hello_world_get_docs = {

Check failure on line 29 in src/actinia_example_plugin/apidocs/project_helloworld.py

View workflow job for this annotation

GitHub Actions / lint / ruff

Ruff (I001)

src/actinia_example_plugin/apidocs/project_helloworld.py:26:1: I001 Import block is un-sorted or un-formatted

Check failure on line 29 in src/actinia_example_plugin/apidocs/project_helloworld.py

View workflow job for this annotation

GitHub Actions / lint / ruff

Ruff (I001)

src/actinia_example_plugin/apidocs/project_helloworld.py:26:1: I001 Import block is un-sorted or un-formatted
# "summary" is taken from the description of the get method
"tags": ["example"],
"description": "Project Hello World example",
Expand All @@ -50,7 +49,7 @@
},
}

describeProjectHelloWorld_post_docs = {
describe_project_hello_world_post_docs = {
# "summary" is taken from the description of the get method
"tags": ["example"],
"description": "Project Hello World example with name",
Expand Down

0 comments on commit 5f61b84

Please sign in to comment.