Merge pull request #51 from alufers/pre-commit-ci-update-config

pull/54/head
Albert Koczy 2 years ago committed by GitHub
commit 90d5f672ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -29,7 +29,7 @@ repos:
hooks: hooks:
- id: mypy - id: mypy
- repo: https://github.com/PyCQA/docformatter - repo: https://github.com/PyCQA/docformatter
rev: v1.6.5 rev: v1.7.1
hooks: hooks:
- id: docformatter - id: docformatter
args: args:
@ -53,7 +53,7 @@ repos:
args: ["-t=3.9-", "--violations"] args: ["-t=3.9-", "--violations"]
# (if your target is specified in a Vermin config, you may omit the 'args' entry entirely) # (if your target is specified in a Vermin config, you may omit the 'args' entry entirely)
- repo: https://github.com/adrienverge/yamllint.git - repo: https://github.com/adrienverge/yamllint.git
rev: v1.31.0 rev: v1.32.0
hooks: hooks:
- id: yamllint - id: yamllint
- repo: https://github.com/igorshubovych/markdownlint-cli - repo: https://github.com/igorshubovych/markdownlint-cli

@ -41,8 +41,7 @@ class HarFlowWrapper:
return self.flow["request"]["url"] return self.flow["request"]["url"]
def get_matching_url(self, prefix) -> Union[str, None]: def get_matching_url(self, prefix) -> Union[str, None]:
"""Get the requests URL if the prefix matches the URL, None """Get the requests URL if the prefix matches the URL, None otherwise."""
otherwise."""
if self.flow["request"]["url"].startswith(prefix): if self.flow["request"]["url"].startswith(prefix):
return self.flow["request"]["url"] return self.flow["request"]["url"]
return None return None

@ -81,8 +81,8 @@ def url_to_params(url, path_template):
def request_to_headers(headers: dict[str, List[Any]], add_example: bool = False): def request_to_headers(headers: dict[str, List[Any]], add_example: bool = False):
"""When given an url and its path template, generates the parameters """When given an url and its path template, generates the parameters section of the
section of the request.""" request."""
params = [] params = []
if headers: if headers:
for key in headers: for key in headers:

@ -23,8 +23,8 @@ def get_nested_key(obj: Any, path: str) -> Any:
def mitmproxy2swagger_e2e_test( def mitmproxy2swagger_e2e_test(
input_file: str, url_prefix: str, extra_args: Optional[List[str]] = None input_file: str, url_prefix: str, extra_args: Optional[List[str]] = None
) -> Any: ) -> Any:
"""Runs mitmproxy2swagger on the given input file twice, and returns the """Runs mitmproxy2swagger on the given input file twice, and returns the detected
detected endpoints.""" endpoints."""
yaml_tmp_path = tempfile.mktemp(suffix=".yaml", prefix="sklep.lisek.") yaml_tmp_path = tempfile.mktemp(suffix=".yaml", prefix="sklep.lisek.")
main( main(
[ [

Loading…
Cancel
Save