Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
artsmolin committed Oct 27, 2023
1 parent 7baa2b8 commit 9a23ce2
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 20 deletions.
6 changes: 0 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,3 @@ repos:
hooks:
- id: mypy
additional_dependencies: [ types-PyYAML ]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
4 changes: 2 additions & 2 deletions examples/petstore/client_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def log_extra(self, **kwargs: Any) -> dict[str, Any]:
return {"props": {"data": kwargs}}

def log_error(self, req: RequestBox, resp: ResponseBox) -> None:
msg = "request error"
msg = f"request error"
msg += f" | client={req.client_name}"
msg += f" | method={req.method}"
msg += f" | url={req.url}"
Expand Down Expand Up @@ -2266,7 +2266,7 @@ def log_extra(self, **kwargs: Any) -> dict[str, Any]:
return {"extra": {"props": {"data": kwargs}}}

def log_error(self, client_name: str, method, url: str, params, content, headers) -> None:
msg = "request error"
msg = f"request error"
msg += f" | client={client_name}"
msg += f" | method={method}"
msg += f" | url={url}"
Expand Down
4 changes: 2 additions & 2 deletions examples/petstore/client_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def log_extra(self, **kwargs: Any) -> dict[str, Any]:
return {"props": {"data": kwargs}}

def log_error(self, req: RequestBox, resp: ResponseBox) -> None:
msg = "request error"
msg = f"request error"
msg += f" | client={req.client_name}"
msg += f" | method={req.method}"
msg += f" | url={req.url}"
Expand Down Expand Up @@ -2242,7 +2242,7 @@ def log_extra(self, **kwargs: Any) -> dict[str, Any]:
return {"extra": {"props": {"data": kwargs}}}

def log_error(self, client_name: str, method, url: str, params, content, headers) -> None:
msg = "request error"
msg = f"request error"
msg += f" | client={client_name}"
msg += f" | method={method}"
msg += f" | url={url}"
Expand Down
4 changes: 2 additions & 2 deletions tests/clients/async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def log_extra(self, **kwargs: Any) -> dict[str, Any]:
return {"props": {"data": kwargs}}

def log_error(self, req: RequestBox, resp: ResponseBox) -> None:
msg = "request error"
msg = f"request error"
msg += f" | client={req.client_name}"
msg += f" | method={req.method}"
msg += f" | url={req.url}"
Expand Down Expand Up @@ -2657,7 +2657,7 @@ def log_extra(self, **kwargs: Any) -> dict[str, Any]:
return {"extra": {"props": {"data": kwargs}}}

def log_error(self, client_name: str, method, url: str, params, content, headers) -> None:
msg = "request error"
msg = f"request error"
msg += f" | client={client_name}"
msg += f" | method={method}"
msg += f" | url={url}"
Expand Down
4 changes: 2 additions & 2 deletions tests/clients/async_client_with_headers.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def log_extra(self, **kwargs: Any) -> dict[str, Any]:
return {"props": {"data": kwargs}}

def log_error(self, req: RequestBox, resp: ResponseBox) -> None:
msg = "request error"
msg = f"request error"
msg += f" | client={req.client_name}"
msg += f" | method={req.method}"
msg += f" | url={req.url}"
Expand Down Expand Up @@ -2660,7 +2660,7 @@ def log_extra(self, **kwargs: Any) -> dict[str, Any]:
return {"extra": {"props": {"data": kwargs}}}

def log_error(self, client_name: str, method, url: str, params, content, headers) -> None:
msg = "request error"
msg = f"request error"
msg += f" | client={client_name}"
msg += f" | method={method}"
msg += f" | url={url}"
Expand Down
4 changes: 2 additions & 2 deletions tests/clients/async_client_with_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def log_extra(self, **kwargs: Any) -> dict[str, Any]:
return {"props": {"data": kwargs}}

def log_error(self, req: RequestBox, resp: ResponseBox) -> None:
msg = "request error"
msg = f"request error"
msg += f" | client={req.client_name}"
msg += f" | method={req.method}"
msg += f" | url={req.url}"
Expand Down Expand Up @@ -2689,7 +2689,7 @@ def log_extra(self, **kwargs: Any) -> dict[str, Any]:
return {"extra": {"props": {"data": kwargs}}}

def log_error(self, client_name: str, method, url: str, params, content, headers) -> None:
msg = "request error"
msg = f"request error"
msg += f" | client={client_name}"
msg += f" | method={method}"
msg += f" | url={url}"
Expand Down
4 changes: 2 additions & 2 deletions tests/clients/sync_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def log_extra(self, **kwargs: Any) -> dict[str, Any]:
return {"props": {"data": kwargs}}

def log_error(self, req: RequestBox, resp: ResponseBox) -> None:
msg = "request error"
msg = f"request error"
msg += f" | client={req.client_name}"
msg += f" | method={req.method}"
msg += f" | url={req.url}"
Expand Down Expand Up @@ -2623,7 +2623,7 @@ def log_extra(self, **kwargs: Any) -> dict[str, Any]:
return {"extra": {"props": {"data": kwargs}}}

def log_error(self, client_name: str, method, url: str, params, content, headers) -> None:
msg = "request error"
msg = f"request error"
msg += f" | client={client_name}"
msg += f" | method={method}"
msg += f" | url={url}"
Expand Down
4 changes: 2 additions & 2 deletions tests/clients/sync_client_with_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def log_extra(self, **kwargs: Any) -> dict[str, Any]:
return {"props": {"data": kwargs}}

def log_error(self, req: RequestBox, resp: ResponseBox) -> None:
msg = "request error"
msg = f"request error"
msg += f" | client={req.client_name}"
msg += f" | method={req.method}"
msg += f" | url={req.url}"
Expand Down Expand Up @@ -2655,7 +2655,7 @@ def log_extra(self, **kwargs: Any) -> dict[str, Any]:
return {"extra": {"props": {"data": kwargs}}}

def log_error(self, client_name: str, method, url: str, params, content, headers) -> None:
msg = "request error"
msg = f"request error"
msg += f" | client={client_name}"
msg += f" | method={method}"
msg += f" | url={url}"
Expand Down

0 comments on commit 9a23ce2

Please sign in to comment.